Mercurial > vim
changeset 30651:c6e85b9a88a0 v9.0.0660
patch 9.0.0660: mapping with CTRL keys does not work in the GUI
Commit: https://github.com/vim/vim/commit/2cd0f27b75c4497bec872819a965b3d6b4d55030
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Oct 4 20:14:28 2022 +0100
patch 9.0.0660: mapping with CTRL keys does not work in the GUI
Problem: Mapping with CTRL keys does not work in the GUI.
Solution: Recognize CSI next to K_SPECIAL. (closes https://github.com/vim/vim/issues/11275, closes https://github.com/vim/vim/issues/11270)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 04 Oct 2022 21:15:03 +0200 |
parents | a0ef66456ec8 |
children | 7fd3744487ae |
files | src/map.c src/testdir/test_gui.vim src/version.c |
diffstat | 3 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/map.c +++ b/src/map.c @@ -1753,7 +1753,11 @@ vim_strsave_escape_csi(char_u *p) d = res; for (s = p; *s != NUL; ) { - if (s[0] == K_SPECIAL && s[1] != NUL && s[2] != NUL) + if ((s[0] == K_SPECIAL +#ifdef FEAT_GUI + || (gui.in_use && s[0] == CSI) +#endif + ) && s[1] != NUL && s[2] != NUL) { // Copy special key unmodified. *d++ = *s++;
--- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -1732,4 +1732,23 @@ func Test_gui_lowlevel_keyevent() bw! endfunc +func Test_gui_macro_csi() + " Test for issue #11270 + nnoremap <C-L> <Cmd>let g:triggered = 1<CR> + let @q = "\x9b\xfc\x04L" + norm @q + call assert_equal(1, g:triggered) + unlet g:triggered + nunmap <C-L> + + " Test for issue #11057 + inoremap <C-D>t bbb + call setline(1, "\t") + let @q = "i\x9b\xfc\x04D" + " The end of :normal is like a mapping timing out + norm @q + call assert_equal('', getline(1)) + iunmap <C-D>t +endfunc + " vim: shiftwidth=2 sts=2 expandtab