]> granicus.if.org Git - vim/commitdiff
patch 8.1.1848: 'langmap' is not used for CTRL-W command in terminal v8.1.1848
authorBram Moolenaar <Bram@vim.org>
Thu, 15 Aug 2019 18:58:54 +0000 (20:58 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 15 Aug 2019 18:58:54 +0000 (20:58 +0200)
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
src/testdir/test_terminal.vim
src/version.c

index 51e242f1966d593aef7ea6ef7b45fce350065bab..95347a16ca01eb828f2c82a6396fbe81cf419ed1 100644 (file)
@@ -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;
            }
index 5496b6325e86da3a9c416d8cae427ee7dc072cbe..e173b42b83f6c0d170f390ccc8a7fc81d7b82e2c 100644 (file)
@@ -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
index b8a84ac9d8599b1b55d608d76e0910272a279ed1..3ec385cfbc4e64d73c8f0727b5269738ab7d7047 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1848,
 /**/
     1847,
 /**/