aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-10-23 19:52:23 -0400
committerJames McCoy <jamessan@jamessan.com>2017-10-24 19:55:29 -0400
commitf1f7f3b5123edbd312ae92e9510c4c86cfe1171d (patch)
tree5f6aa20c420ad8eab93bdf51ef8d83e05f99a9a5 /src
parente35a66d39670d19d50bf732b3058c12e33c77440 (diff)
downloadrneovim-f1f7f3b5123edbd312ae92e9510c4c86cfe1171d.tar.gz
rneovim-f1f7f3b5123edbd312ae92e9510c4c86cfe1171d.tar.bz2
rneovim-f1f7f3b5123edbd312ae92e9510c4c86cfe1171d.zip
inccommand: Ignore leading modifiers in the command
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index f64c9fded8..096187b162 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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);