mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4237: record buffer wrong if character in Select mode was not typed
Problem: Record buffer wrong if character in Select mode was not typed.
Solution: Only delete the tail from the record buffer if the character was
typed. (closes vim/vim#9650)
fbf4f1ca15
This commit is contained in:
parent
175692325b
commit
bea439fe99
@ -1013,9 +1013,11 @@ static int normal_execute(VimState *state, int key)
|
||||
// be mapped in Insert mode. Required for ":lmap" to work.
|
||||
int len = ins_char_typebuf(s->c, mod_mask);
|
||||
|
||||
// When recording the character will be recorded again, remove the
|
||||
// previously recording.
|
||||
// When recording and gotchars() was called the character will be
|
||||
// recorded again, remove the previous recording.
|
||||
if (KeyTyped) {
|
||||
ungetchars(len);
|
||||
}
|
||||
|
||||
if (restart_edit != 0) {
|
||||
s->c = 'd';
|
||||
|
@ -517,6 +517,17 @@ func Test_record_in_select_mode()
|
||||
sil norm q00
|
||||
sil norm q
|
||||
call assert_equal('0ext', getline(1))
|
||||
|
||||
%delete
|
||||
let @r = ''
|
||||
call setline(1, ['abc', 'abc', 'abc'])
|
||||
smap <F2> <Right><Right>,
|
||||
call feedkeys("qrgh\<F2>Dk\<Esc>q", 'xt')
|
||||
call assert_equal("gh\<F2>Dk\<Esc>", @r)
|
||||
norm j0@rj0@@
|
||||
call assert_equal([',Dk', ',Dk', ',Dk'], getline(1, 3))
|
||||
sunmap <F2>
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user