Skip to content

Commit

Permalink
feat: handle case where we can't create file explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-rev committed Feb 22, 2025
1 parent 674afbf commit 49ccb6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,9 @@ fn refresh_file_explorer(cursor: u32, cx: &mut Context, root: PathBuf) {
let call: Callback = Callback::EditorCompositor(Box::new(move |editor, compositor| {
// replace the old file explorer with the new one
compositor.pop();
if let Ok(picker) = file_explorer(Some(cursor), root, editor) {
compositor.push(Box::new(overlay::overlaid(picker)));
match file_explorer(Some(cursor), root, editor) {
Ok(file_explorer) => compositor.push(Box::new(overlay::overlaid(file_explorer))),
Err(err) => editor.set_error(err.to_string()),
}
}));
Ok(call)
Expand Down

0 comments on commit 49ccb6c

Please sign in to comment.