From: Bram Moolenaar Date: Tue, 18 May 2021 19:38:45 +0000 (+0200) Subject: patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R X-Git-Tag: v8.2.2870 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=796139ae3ac89e27ee96dce3c7fdb87d8c839f53;p=vim patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R Problem: CmdlineChange event triggered twice for CTRL-R. Solution: Return CMDLINE_NOT_CHANGED from cmdline_insert_reg(). (closes #8219) --- diff --git a/src/ex_getln.c b/src/ex_getln.c index 4ebc34110..e7d71a510 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1253,8 +1253,11 @@ cmdline_insert_reg(int *gotesc UNUSED) } #endif } + // remove the double quote redrawcmd(); - return CMDLINE_CHANGED; + + // The text has been stuffed, the command line didn't change yet. + return CMDLINE_NOT_CHANGED; } /* diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 5ed283f1f..bba7e725e 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1810,6 +1810,12 @@ func Test_cmd_map_cmdlineChanged() call feedkeys(":\\", 'xt') call assert_equal(['l', 'ls'], g:log) + let @b = 'b' + cnoremap ab + let g:log = [] + call feedkeys(":\\", 'xt') + call assert_equal(['a', 'ab'], g:log) + unlet g:log cunmap augroup test diff --git a/src/version.c b/src/version.c index 0b17d91af..edc95e561 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2870, /**/ 2869, /**/