Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
vim: Add highlighting to set commands (#28600)
5brian730f2e70835e
diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rsindex 15f008f91d4..264edca0b10 100644--- a/crates/vim/src/command.rs+++ b/crates/vim/src/command.rs@@ -963,7 +963,15 @@ pub fn command_interceptor(mut input: &str, cx: &App) -> Vec<CommandInterceptRes.boxed_clone(),)} else if query.starts_with("se ") || query.starts_with("set ") {- return VimOption::possible_commands(query.split_once(" ").unwrap().1);+ let (prefix, option) = query.split_once(' ').unwrap();+ let mut commands = VimOption::possible_commands(option);+ if !commands.is_empty() {+ let query = prefix.to_string() + " " + option;+ for command in &mut commands {+ command.positions = generate_positions(&command.string, &query);+ }+ }+ return commands;} else if query.starts_with('s') {let mut substitute = "substitute".chars().peekable();let mut query = query.chars().peekable();