diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-05-03 06:11:22 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-05-03 06:21:50 +0800 |
| commit | 27149e0071c3fa38c81526f63a997bedfd6e2be8 (patch) | |
| tree | 8d819a934bd5c11c7947ff06bea23a609723d078 /src/nvim/testdir/test_eval_stuff.vim | |
| parent | ddf7bb24f98b468d2bc6c16c6f300570fc6530f5 (diff) | |
| download | rneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.tar.gz rneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.tar.bz2 rneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.zip | |
vim-patch:8.2.4858: K_SPECIAL may be escaped twice
Problem: K_SPECIAL may be escaped twice.
Solution: Avoid double escaping. (closes vim/vim#10340)
https://github.com/vim/vim/commit/db08887f24d20be11d184ce321bc0890613e42bd
Diffstat (limited to 'src/nvim/testdir/test_eval_stuff.vim')
| -rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 95eccde35c..811c6c946d 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -320,4 +320,26 @@ func Test_curly_assignment() unlet g:gvar endfunc +" K_SPECIAL in the modified character used be escaped, which causes +" double-escaping with feedkeys() or as the return value of an <expr> mapping, +" and doesn't match what getchar() returns, +func Test_modified_char_no_escape_special() + nnoremap <M-…> <Cmd>let g:got_m_ellipsis += 1<CR> + call feedkeys("\<M-…>", 't') + call assert_equal("\<M-…>", getchar()) + let g:got_m_ellipsis = 0 + call feedkeys("\<M-…>", 'xt') + call assert_equal(1, g:got_m_ellipsis) + func Func() + return "\<M-…>" + endfunc + nmap <expr> <F2> Func() + call feedkeys("\<F2>", 'xt') + call assert_equal(2, g:got_m_ellipsis) + delfunc Func + nunmap <F2> + unlet g:got_m_ellipsis + nunmap <M-…> +endfunc + " vim: shiftwidth=2 sts=2 expandtab |