summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-09 12:41:32 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-09 12:41:32 +0000
commit148bcd361097f85a1a51c408e7412d60c76df14d (patch)
tree1644a6bbbd9e09bfb5c4bc32768f47d294c1e0ed /src/ex_getln.c
parentbb393d8259af8aec095e96d81624a16ed9f25005 (diff)
patch 9.0.1040: test for <Cmd> mapping with CmdlineChanged failsv9.0.1040
Problem: Test for <Cmd> mapping with CmdlineChanged fails. Solution: Put back the check for the cmdline length not changing.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 0eb7d86c10..5614ea6a9e 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1785,13 +1785,16 @@ getcmdline_int(
if (c == K_COMMAND || c == K_SCRIPT_COMMAND)
{
+ int clen = ccline.cmdlen;
int cc_count = aucmd_cmdline_changed_count;
if (do_cmdkey_command(c, DOCMD_NOWAIT) == OK)
{
- // Do not trigger CmdlineChanged below if the <Cmd> mapping
- // already did that.
- if (cc_count != aucmd_cmdline_changed_count)
+ // Do not trigger CmdlineChanged below if:
+ // - the length of the command line didn't change
+ // - the <Cmd> mapping already triggered the event
+ if (clen == ccline.cmdlen
+ || cc_count != aucmd_cmdline_changed_count)
trigger_cmdlinechanged = FALSE;
goto cmdline_changed;
}