Skip to content

Commit

Permalink
do not panic on picker open failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dead10ck committed Jun 4, 2022
1 parent f562464 commit 01eb375
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
path.strip_prefix(&root).unwrap_or(path).to_string_lossy()
},
move |cx, path: &PathBuf, action| {
cx.editor.open(path, action).expect("editor.open failed");
if let Err(err) = cx.editor.open(path, action) {
let err = format!("{}", err);
log::error!("{}", err);
cx.editor.set_error(err);
}
},
|_editor, path| Some((path.clone(), None)),
)
Expand Down

0 comments on commit 01eb375

Please sign in to comment.