Mercurial > vim
changeset 24663:ce7a80bd0fd5 v8.2.2870
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Commit: https://github.com/vim/vim/commit/796139ae3ac89e27ee96dce3c7fdb87d8c839f53
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 18 21:38:45 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 18 May 2021 21:45:03 +0200 |
parents | e7e7b4f11187 |
children | a9cb1f88ff40 |
files | src/ex_getln.c src/testdir/test_cmdline.vim src/version.c |
diffstat | 3 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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; } /*
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -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