diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index a80a6fd..89ea94a 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -2023,9 +2023,11 @@ pub fn command_interceptor( positions, }); } + // Palette searches like "split selection" or "edit prediction" also + // parse as a command with a filename, so keep the regular matches. CommandInterceptResult { results, - exclusive: true, + exclusive: false, } }) } else { @@ -2634,6 +2636,7 @@ mod test { use crate::{ VimAddon, + command::command_interceptor, state::Mode, test::{NeovimBackedTestContext, VimTestContext}, }; @@ -2984,6 +2987,28 @@ mod test { }); } + #[gpui::test] + async fn test_filename_completions_keep_palette_matches(cx: &mut TestAppContext) { + let mut cx = VimTestContext::new(cx, true).await; + let workspace = cx.workspace(|_, _, cx| cx.weak_entity()); + + let intercept_result = cx + .update(|_, cx| command_interceptor("split selection", workspace, cx)) + .await; + + assert_eq!( + intercept_result + .results + .first() + .map(|item| item.string.as_str()), + Some(":split selection") + ); + assert!( + !intercept_result.exclusive, + "filename completions must not hide the regular command palette matches" + ); + } + #[gpui::test] async fn test_command_write_filename(cx: &mut TestAppContext) { let mut cx = VimTestContext::new(cx, true).await;