diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 20:50:54 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 20:55:44 -0400 |
commit | 23936115880ba3c9e716f9c3b5d7b89453cd65fc (patch) | |
tree | 2800583f742ac06c4ba7bb5b0c754a04cdd9cb0e /src/nvim/testdir | |
parent | 21f160746a4b406f84311a64fff96c1bd52f23c9 (diff) | |
download | rneovim-23936115880ba3c9e716f9c3b5d7b89453cd65fc.tar.gz rneovim-23936115880ba3c9e716f9c3b5d7b89453cd65fc.tar.bz2 rneovim-23936115880ba3c9e716f9c3b5d7b89453cd65fc.zip |
vim-patch:8.1.0995: a getchar() call resets the reg_executing() result
Problem: A getchar() call while executing a register resets the
reg_executing() result.
Solution: Save and restore reg_executing. (closes vim/vim#406
https://github.com/vim/vim/commit/f0fab3046c2b5c4115979347464a802853011220
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index e41af6d7f2..d58e4f8758 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1097,6 +1097,27 @@ func Test_reg_executing_and_recording() call feedkeys("q\"\"=s:save_reg_stat()\<CR>pq", 'xt') call assert_equal('":', s:reg_stat) + " :normal command saves and restores reg_executing + let s:reg_stat = '' + + " getchar() command saves and restores reg_executing + map W :call TestFunc()<CR> + let @q = "W" + func TestFunc() abort + let g:reg1 = reg_executing() + let g:typed = getchar(0) + let g:reg2 = reg_executing() + endfunc + call feedkeys("@qy", 'xt') + call assert_equal(char2nr("y"), g:typed) + call assert_equal('q', g:reg1) + call assert_equal('q', g:reg2) + delfunc TestFunc + unmap W + unlet g:typed + unlet g:reg1 + unlet g:reg2 + bwipe! delfunc s:save_reg_stat unlet s:reg_stat |