summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-09 12:21:50 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-09 12:21:50 +0000
commitbb393d8259af8aec095e96d81624a16ed9f25005 (patch)
tree3d932f3f5377e4e902a7ae731e4b4b75f1bbe5c1 /src/ex_getln.c
parentffa4e9b43a3d6d7f412f54637a4b1076ed2bc2f4 (diff)
patch 9.0.1039: using a <Cmd> mapping CmdlineChanged may be triggered twicev9.0.1039
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice. Solution: Count the number of times CmdlineChanged is triggered and avoid doing it twice. (closes #116820
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 4bd200d33f..0eb7d86c10 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1785,11 +1785,13 @@ 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)
{
- if (clen == ccline.cmdlen)
+ // Do not trigger CmdlineChanged below if the <Cmd> mapping
+ // already did that.
+ if (cc_count != aucmd_cmdline_changed_count)
trigger_cmdlinechanged = FALSE;
goto cmdline_changed;
}