0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2021-05-18 21:38:45 +02:00
parent 485b627100
commit 796139ae3a
3 changed files with 12 additions and 1 deletions

View File

@@ -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;
}
/*

View File

@@ -1810,6 +1810,12 @@ func Test_cmd_map_cmdlineChanged()
call feedkeys(":\<F1>\<CR>", 'xt')
call assert_equal(['l', 'ls'], g:log)
let @b = 'b'
cnoremap <F1> a<C-R>b
let g:log = []
call feedkeys(":\<F1>\<CR>", 'xt')
call assert_equal(['a', 'ab'], g:log)
unlet g:log
cunmap <F1>
augroup test

View File

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