inccommand: Ignore leading modifiers in the command

This commit is contained in:
James McCoy
2017-10-23 19:52:23 -04:00
parent e35a66d396
commit f1f7f3b512
2 changed files with 45 additions and 1 deletions

View File

@@ -9883,7 +9883,7 @@ static void ex_terminal(exarg_T *eap)
/// Checks if `cmd` is "previewable" (i.e. supported by 'inccommand').
///
/// @param[in] cmd Commandline to check. May start with a range.
/// @param[in] cmd Commandline to check. May start with a range or modifier.
///
/// @return true if `cmd` is previewable
bool cmd_can_preview(char_u *cmd)
@@ -9892,6 +9892,12 @@ bool cmd_can_preview(char_u *cmd)
return false;
}
// Ignore any leading modifiers (:keeppatterns, :verbose, etc.)
for (int len = modifier_len(cmd); len != 0; len = modifier_len(cmd)) {
cmd += len;
cmd = skipwhite(cmd);
}
exarg_T ea;
// parse the command line
ea.cmd = skip_range(cmd, NULL);