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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -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
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2870,
|
||||
/**/
|
||||
2869,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user