Mercurial > vim
comparison src/terminal.c @ 13344:68c4fc9ae216 v8.0.1546
patch 8.0.1546: using feedkeys() in a terminal may trigger mappings
commit https://github.com/vim/vim/commit/c8bcfe7efd4cfdfd7f503700aba45c42765cd4dc
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 27 16:29:28 2018 +0100
patch 8.0.1546: using feedkeys() in a terminal may trigger mappings
Problem: Using feedkeys() in a terminal window may trigger mappings.
(Charles Sheridan)
Solution: Avoid triggering a mapping when peeking for a key.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 27 Feb 2018 16:30:05 +0100 |
parents | 73325d39591a |
children | 69517d67421f |
comparison
equal
deleted
inserted
replaced
13343:3e2d3a45aca3 | 13344:68c4fc9ae216 |
---|---|
1304 cleanup_vterm(term); | 1304 cleanup_vterm(term); |
1305 redraw_buf_and_status_later(curbuf, NOT_VALID); | 1305 redraw_buf_and_status_later(curbuf, NOT_VALID); |
1306 } | 1306 } |
1307 | 1307 |
1308 /* | 1308 /* |
1309 * Get a key from the user without mapping. | 1309 * Get a key from the user with terminal mode mappings. |
1310 * Note: while waiting a terminal may be closed and freed if the channel is | 1310 * Note: while waiting a terminal may be closed and freed if the channel is |
1311 * closed and ++close was used. | 1311 * closed and ++close was used. |
1312 * Uses terminal mode mappings. | |
1313 */ | 1312 */ |
1314 static int | 1313 static int |
1315 term_vgetc() | 1314 term_vgetc() |
1316 { | 1315 { |
1317 int c; | 1316 int c; |
1631 if (*curwin->w_p_tk != NUL) | 1630 if (*curwin->w_p_tk != NUL) |
1632 termkey = string_to_key(curwin->w_p_tk, TRUE); | 1631 termkey = string_to_key(curwin->w_p_tk, TRUE); |
1633 position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); | 1632 position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); |
1634 may_set_cursor_props(curbuf->b_term); | 1633 may_set_cursor_props(curbuf->b_term); |
1635 | 1634 |
1636 while (blocking || vpeekc() != NUL) | 1635 while (blocking || vpeekc_nomap() != NUL) |
1637 { | 1636 { |
1638 /* TODO: skip screen update when handling a sequence of keys. */ | 1637 /* TODO: skip screen update when handling a sequence of keys. */ |
1639 /* Repeat redrawing in case a message is received while redrawing. */ | 1638 /* Repeat redrawing in case a message is received while redrawing. */ |
1640 while (must_redraw != 0) | 1639 while (must_redraw != 0) |
1641 if (update_screen(0) == FAIL) | 1640 if (update_screen(0) == FAIL) |