Mercurial > vim
comparison src/terminal.c @ 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 | e271ca6f32f9 |
children | 08b0b6d6cbe7 |
comparison
equal
deleted
inserted
replaced
14108:a8d728a64b3d | 14109:279465096a16 |
---|---|
2105 * shell and ++close was used. Therefore use curbuf->b_term instead of a | 2105 * shell and ++close was used. Therefore use curbuf->b_term instead of a |
2106 * stored reference. */ | 2106 * stored reference. */ |
2107 in_terminal_loop = curbuf->b_term; | 2107 in_terminal_loop = curbuf->b_term; |
2108 | 2108 |
2109 if (*curwin->w_p_twk != NUL) | 2109 if (*curwin->w_p_twk != NUL) |
2110 { | |
2110 termwinkey = string_to_key(curwin->w_p_twk, TRUE); | 2111 termwinkey = string_to_key(curwin->w_p_twk, TRUE); |
2112 if (termwinkey == Ctrl_W) | |
2113 termwinkey = 0; | |
2114 } | |
2111 position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); | 2115 position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); |
2112 may_set_cursor_props(curbuf->b_term); | 2116 may_set_cursor_props(curbuf->b_term); |
2113 | 2117 |
2114 while (blocking || vpeekc_nomap() != NUL) | 2118 while (blocking || vpeekc_nomap() != NUL) |
2115 { | 2119 { |
2201 else if (c == Ctrl_C) | 2205 else if (c == Ctrl_C) |
2202 { | 2206 { |
2203 /* "CTRL-W CTRL-C" or 'termwinkey' CTRL-C: end the job */ | 2207 /* "CTRL-W CTRL-C" or 'termwinkey' CTRL-C: end the job */ |
2204 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); | 2208 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); |
2205 } | 2209 } |
2206 else if (termwinkey == 0 && c == '.') | 2210 else if (c == '.') |
2207 { | 2211 { |
2208 /* "CTRL-W .": send CTRL-W to the job */ | 2212 /* "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; | |
2210 } | 2215 } |
2211 else if (termwinkey == 0 && c == Ctrl_BSL) | 2216 else if (c == Ctrl_BSL) |
2212 { | 2217 { |
2213 /* "CTRL-W CTRL-\": send CTRL-\ to the job */ | 2218 /* "CTRL-W CTRL-\": send CTRL-\ to the job */ |
2214 c = Ctrl_BSL; | 2219 c = Ctrl_BSL; |
2215 } | 2220 } |
2216 else if (c == 'N') | 2221 else if (c == 'N') |