diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c4f99ee3b..7decc5777 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2957,8 +2957,14 @@ fn file_browser(cx: &mut Context) { let path = match doc_dir { Some(path) => path, None => { - cx.editor.set_error("Current buffer has no path or parent"); - return; + let cwd = helix_stdx::env::current_working_dir(); + if !cwd.exists() { + cx.editor.set_error( + "Current buffer has no parent and current working directory does not exist", + ); + return; + } + cwd } };