0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.0.1040: test for <Cmd> mapping with CmdlineChanged fails

Problem:    Test for <Cmd> mapping with CmdlineChanged fails.
Solution:   Put back the check for the cmdline length not changing.
This commit is contained in:
Bram Moolenaar 2022-12-09 12:41:32 +00:00
parent bb393d8259
commit 148bcd3610
2 changed files with 8 additions and 3 deletions

View File

@ -1785,13 +1785,16 @@ getcmdline_int(
if (c == K_COMMAND || c == K_SCRIPT_COMMAND) if (c == K_COMMAND || c == K_SCRIPT_COMMAND)
{ {
int clen = ccline.cmdlen;
int cc_count = aucmd_cmdline_changed_count; int cc_count = aucmd_cmdline_changed_count;
if (do_cmdkey_command(c, DOCMD_NOWAIT) == OK) if (do_cmdkey_command(c, DOCMD_NOWAIT) == OK)
{ {
// Do not trigger CmdlineChanged below if the <Cmd> mapping // Do not trigger CmdlineChanged below if:
// already did that. // - the length of the command line didn't change
if (cc_count != aucmd_cmdline_changed_count) // - the <Cmd> mapping already triggered the event
if (clen == ccline.cmdlen
|| cc_count != aucmd_cmdline_changed_count)
trigger_cmdlinechanged = FALSE; trigger_cmdlinechanged = FALSE;
goto cmdline_changed; goto cmdline_changed;
} }

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1040,
/**/ /**/
1039, 1039,
/**/ /**/