From a4b2699e28a30dcc4d1696b317f24a8904ec2a06 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 15 Aug 2019 20:58:54 +0200 Subject: 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) --- src/terminal.c | 9 +++++++-- src/testdir/test_terminal.vim | 7 +++++++ src/version.c | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index 51e242f19..95347a16c 100644 --- 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; } diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 5496b6325..e173b42b8 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1686,6 +1686,13 @@ func Test_terminal_termwinkey() call feedkeys("\w", 'tx') call assert_equal(termwin, win_getid()) + set langmap=xjyk + call feedkeys("\x", 'tx') + call assert_equal(thiswin, win_getid()) + call feedkeys("\y", 'tx') + call assert_equal(termwin, win_getid()) + set langmap= + call feedkeys("\gt", "xt") call assert_equal(3, tabpagenr()) tabprev diff --git a/src/version.c b/src/version.c index b8a84ac9d..3ec385cfb 100644 --- a/src/version.c +++ b/src/version.c @@ -769,6 +769,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1848, /**/ 1847, /**/ -- cgit v1.2.1