Mercurial > vim
changeset 17702:ba18f78c8529 v8.1.1848
patch 8.1.1848: 'langmap' is not used for CTRL-W command in terminal
commit https://github.com/vim/vim/commit/a4b2699e28a30dcc4d1696b317f24a8904ec2a06
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 15 20:58:54 2019 +0200
patch 8.1.1848: 'langmap' is not used for CTRL-W command in terminal
Problem: 'langmap' is not used for CTRL-W command in terminal.
Solution: Push the command in the typeahead buffer instead of the stuff
buffer. (closes #4814)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Aug 2019 21:00:04 +0200 |
parents | 4317f22624e8 |
children | 6d74651e8dca |
files | src/terminal.c src/testdir/test_terminal.vim src/version.c |
diffstat | 3 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -2372,8 +2372,13 @@ terminal_loop(int blocking) } else if (termwinkey == 0 || c != termwinkey) { - stuffcharReadbuff(Ctrl_W); - stuffcharReadbuff(c); + char_u buf[MB_MAXBYTES + 2]; + + // Put the command into the typeahead buffer, when using the + // stuff buffer KeyStuffed is set and 'langmap' won't be used. + buf[0] = Ctrl_W; + buf[(*mb_char2bytes)(c, buf + 1) + 1] = NUL; + ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE); ret = OK; goto theend; }
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1686,6 +1686,13 @@ func Test_terminal_termwinkey() call feedkeys("\<C-W>w", 'tx') call assert_equal(termwin, win_getid()) + set langmap=xjyk + call feedkeys("\<C-L>x", 'tx') + call assert_equal(thiswin, win_getid()) + call feedkeys("\<C-W>y", 'tx') + call assert_equal(termwin, win_getid()) + set langmap= + call feedkeys("\<C-L>gt", "xt") call assert_equal(3, tabpagenr()) tabprev