Skip to content

Commit dcdeaaf

Browse files
committed
patch 8.1.0072: use of 'termwinkey' is inconsistent
Problem: Use of 'termwinkey' is inconsistent. Solution: Change the documentation and the behavior. (Ken Takata)
1 parent b3307b5 commit dcdeaaf

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

runtime/doc/terminal.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ to the job. For example:
8787
'termwinkey' CTRL-W move focus to the next window
8888
'termwinkey' : enter an Ex command
8989
'termwinkey' 'termwinkey' send 'termwinkey' to the job in the terminal
90-
'termwinkey' . send a CTRL-W to the job in the terminal
90+
'termwinkey' . send 'termwinkey' to the job in the terminal
91+
'termwinkey' CTRL-\ send a CTRL-\ to the job in the terminal
9192
'termwinkey' N go to terminal Normal mode, see below
9293
'termwinkey' CTRL-N same as CTRL-W N
9394
'termwinkey' CTRL-C same as |t_CTRL-W_CTRL-C|

src/terminal.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,11 @@ terminal_loop(int blocking)
21072107
in_terminal_loop = curbuf->b_term;
21082108

21092109
if (*curwin->w_p_twk != NUL)
2110+
{
21102111
termwinkey = string_to_key(curwin->w_p_twk, TRUE);
2112+
if (termwinkey == Ctrl_W)
2113+
termwinkey = 0;
2114+
}
21112115
position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
21122116
may_set_cursor_props(curbuf->b_term);
21132117

@@ -2203,12 +2207,13 @@ terminal_loop(int blocking)
22032207
/* "CTRL-W CTRL-C" or 'termwinkey' CTRL-C: end the job */
22042208
mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill");
22052209
}
2206-
else if (termwinkey == 0 && c == '.')
2210+
else if (c == '.')
22072211
{
22082212
/* "CTRL-W .": send CTRL-W to the job */
2209-
c = Ctrl_W;
2213+
/* "'termwinkey' .": send 'termwinkey' to the job */
2214+
c = termwinkey == 0 ? Ctrl_W : termwinkey;
22102215
}
2211-
else if (termwinkey == 0 && c == Ctrl_BSL)
2216+
else if (c == Ctrl_BSL)
22122217
{
22132218
/* "CTRL-W CTRL-\": send CTRL-\ to the job */
22142219
c = Ctrl_BSL;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
72,
764766
/**/
765767
71,
766768
/**/

0 commit comments

Comments
 (0)