]> granicus.if.org Git - vim/commitdiff
patch 8.1.0072: use of 'termwinkey' is inconsistent v8.1.0072
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Jun 2018 20:19:12 +0000 (22:19 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Jun 2018 20:19:12 +0000 (22:19 +0200)
Problem:    Use of 'termwinkey' is inconsistent.
Solution:   Change the documentation and the behavior. (Ken Takata)

runtime/doc/terminal.txt
src/terminal.c
src/version.c

index 8f95fc227c3e0eee5cf47f450120fe9fcce8451c..a6c40f6ef15adc6a0a084d349c5155b53f97c84f 100644 (file)
@@ -87,7 +87,8 @@ to the job.  For example:
        'termwinkey' CTRL-W    move focus to the next window
        'termwinkey' :         enter an Ex command
        'termwinkey' 'termwinkey' send 'termwinkey' to the job in the terminal
-       'termwinkey' .         send a CTRL-W to the job in the terminal
+       'termwinkey' .         send 'termwinkey' to the job in the terminal
+       'termwinkey' CTRL-\    send a CTRL-\ to the job in the terminal
        'termwinkey' N         go to terminal Normal mode, see below
        'termwinkey' CTRL-N    same as CTRL-W N
        'termwinkey' CTRL-C    same as |t_CTRL-W_CTRL-C|
index 9b7bc038d27f6037f464e3fdf7e667e2d5c510fa..f4fa551659198d1813b3c890c0d39ebde420470c 100644 (file)
@@ -2107,7 +2107,11 @@ terminal_loop(int blocking)
     in_terminal_loop = curbuf->b_term;
 
     if (*curwin->w_p_twk != NUL)
+    {
        termwinkey = string_to_key(curwin->w_p_twk, TRUE);
+       if (termwinkey == Ctrl_W)
+           termwinkey = 0;
+    }
     position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
     may_set_cursor_props(curbuf->b_term);
 
@@ -2203,12 +2207,13 @@ terminal_loop(int blocking)
                /* "CTRL-W CTRL-C" or 'termwinkey' CTRL-C: end the job */
                mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill");
            }
-           else if (termwinkey == 0 && c == '.')
+           else if (c == '.')
            {
                /* "CTRL-W .": send CTRL-W to the job */
-               c = Ctrl_W;
+               /* "'termwinkey' .": send 'termwinkey' to the job */
+               c = termwinkey == 0 ? Ctrl_W : termwinkey;
            }
-           else if (termwinkey == 0 && c == Ctrl_BSL)
+           else if (c == Ctrl_BSL)
            {
                /* "CTRL-W CTRL-\": send CTRL-\ to the job */
                c = Ctrl_BSL;
index 366e845bf9062652bc01785aacb137c632ea4332..6ce67802d7f482c79862431a6730eada34b50993 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    72,
 /**/
     71,
 /**/