Mercurial > vim
changeset 14109:279465096a16 v8.1.0072
patch 8.1.0072: use of 'termwinkey' is inconsistent
commit https://github.com/vim/vim/commit/dcdeaaf1505b96aa7a31ccd4becc92c32119bdda
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 17 22:19:12 2018 +0200
patch 8.1.0072: use of 'termwinkey' is inconsistent
Problem: Use of 'termwinkey' is inconsistent.
Solution: Change the documentation and the behavior. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jun 2018 22:30:06 +0200 |
parents | a8d728a64b3d |
children | 50678c288c53 |
files | runtime/doc/terminal.txt src/terminal.c src/version.c |
diffstat | 3 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -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|
--- a/src/terminal.c +++ b/src/terminal.c @@ -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;