mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
inccommand: Preview :sub commands only after the delimiter is present
Closes #5888
This commit is contained in:
@@ -9674,9 +9674,20 @@ bool cmd_can_preview(char_u *cmd)
|
||||
if (*ea.cmd == '*') {
|
||||
ea.cmd = skipwhite(ea.cmd + 1);
|
||||
}
|
||||
find_command(&ea, NULL);
|
||||
char_u *end = find_command(&ea, NULL);
|
||||
|
||||
return ea.cmdidx == CMD_substitute
|
||||
|| ea.cmdidx == CMD_smagic
|
||||
|| ea.cmdidx == CMD_snomagic;
|
||||
switch (ea.cmdidx) {
|
||||
case CMD_substitute:
|
||||
case CMD_smagic:
|
||||
case CMD_snomagic:
|
||||
// Only preview once the pattern delimiter has been typed
|
||||
if (*end && !ASCII_ISALNUM(*end)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user