Mercurial > vim
comparison src/testdir/test_eval_stuff.vim @ 28668:53c608c7ea9e v8.2.4858
patch 8.2.4858: K_SPECIAL may be escaped twice
Commit: https://github.com/vim/vim/commit/db08887f24d20be11d184ce321bc0890613e42bd
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon May 2 22:53:45 2022 +0100
patch 8.2.4858: K_SPECIAL may be escaped twice
Problem: K_SPECIAL may be escaped twice.
Solution: Avoid double escaping. (closes https://github.com/vim/vim/issues/10340)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 03 May 2022 00:00:04 +0200 |
parents | 84682ad16c31 |
children | 5063dfe96a59 |
comparison
equal
deleted
inserted
replaced
28667:7782b07d29ca | 28668:53c608c7ea9e |
---|---|
593 func Test_deep_recursion() | 593 func Test_deep_recursion() |
594 " this was running out of stack | 594 " this was running out of stack |
595 call assert_fails("exe 'if ' .. repeat('(', 1002)", 'E1169: Expression too recursive: ((') | 595 call assert_fails("exe 'if ' .. repeat('(', 1002)", 'E1169: Expression too recursive: ((') |
596 endfunc | 596 endfunc |
597 | 597 |
598 " K_SPECIAL in the modified character used be escaped, which causes | |
599 " double-escaping with feedkeys() or as the return value of an <expr> mapping, | |
600 " and doesn't match what getchar() returns, | |
601 func Test_modified_char_no_escape_special() | |
602 nnoremap <M-…> <Cmd>let g:got_m_ellipsis += 1<CR> | |
603 call feedkeys("\<M-…>", 't') | |
604 call assert_equal("\<M-…>", getchar()) | |
605 let g:got_m_ellipsis = 0 | |
606 call feedkeys("\<M-…>", 'xt') | |
607 call assert_equal(1, g:got_m_ellipsis) | |
608 func Func() | |
609 return "\<M-…>" | |
610 endfunc | |
611 nmap <expr> <F2> Func() | |
612 call feedkeys("\<F2>", 'xt') | |
613 call assert_equal(2, g:got_m_ellipsis) | |
614 delfunc Func | |
615 nunmap <F2> | |
616 unlet g:got_m_ellipsis | |
617 nunmap <M-…> | |
618 endfunc | |
619 | |
598 " vim: shiftwidth=2 sts=2 expandtab | 620 " vim: shiftwidth=2 sts=2 expandtab |