From de3ef339591c8496ea425728505c2f36c35531d7 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sat, 23 Mar 2024 17:16:59 +0100 Subject: [PATCH] Open a new file if nothing was found after globbing --- helix-term/src/commands/typed.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 41cacde44..54fb91e00 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -213,6 +213,12 @@ fn open(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> } to_open.push(entry.into_path()); } + + if to_open.is_empty() { + open_file(cx, &path, pos)?; + continue; + } + for path in to_open { open_file(cx, &path, pos)?; }