From f8e0011534a3f94cfd341fd9bfce1bcf9b1b7b73 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 20 Sep 2021 08:42:18 -0700 Subject: fix(inccommand): ignore trailing commands only for *previewed* command #15732 Since the `State` is global, other scripts are unexpectedly affected during the 'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in order to ignore trailing '|'-separated commands only for the command invoking the preview. fix #8796, update #7494 Co-authored-by: itchyny --- src/nvim/ex_getln.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index f63987136f..33c0097ba4 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2251,7 +2251,7 @@ static int command_line_changed(CommandLineState *s) State |= CMDPREVIEW; emsg_silent++; // Block error reporting as the command may be incomplete msg_silent++; // Block messages, namely ones that prompt - do_cmdline(ccline.cmdbuff, NULL, NULL, DOCMD_KEEPLINE|DOCMD_NOWAIT); + do_cmdline(ccline.cmdbuff, NULL, NULL, DOCMD_KEEPLINE|DOCMD_NOWAIT|DOCMD_PREVIEW); msg_silent--; // Unblock messages emsg_silent--; // Unblock error reporting -- cgit