0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2018-02-27 16:29:28 +01:00
parent 8226ac6b59
commit c8bcfe7efd
3 changed files with 5 additions and 4 deletions

View File

@@ -1854,7 +1854,7 @@ vpeekc(void)
return vgetorpeek(FALSE); return vgetorpeek(FALSE);
} }
#if defined(FEAT_TERMRESPONSE) || defined(PROTO) #if defined(FEAT_TERMRESPONSE) || defined(FEAT_TERMINAL) || defined(PROTO)
/* /*
* Like vpeekc(), but don't allow mapping. Do allow checking for terminal * Like vpeekc(), but don't allow mapping. Do allow checking for terminal
* codes. * codes.

View File

@@ -1306,10 +1306,9 @@ term_enter_job_mode()
} }
/* /*
* Get a key from the user without mapping. * Get a key from the user with terminal mode mappings.
* Note: while waiting a terminal may be closed and freed if the channel is * Note: while waiting a terminal may be closed and freed if the channel is
* closed and ++close was used. * closed and ++close was used.
* Uses terminal mode mappings.
*/ */
static int static int
term_vgetc() term_vgetc()
@@ -1633,7 +1632,7 @@ terminal_loop(int blocking)
position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
may_set_cursor_props(curbuf->b_term); may_set_cursor_props(curbuf->b_term);
while (blocking || vpeekc() != NUL) while (blocking || vpeekc_nomap() != NUL)
{ {
/* TODO: skip screen update when handling a sequence of keys. */ /* TODO: skip screen update when handling a sequence of keys. */
/* Repeat redrawing in case a message is received while redrawing. */ /* Repeat redrawing in case a message is received while redrawing. */

View File

@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1546,
/**/ /**/
1545, 1545,
/**/ /**/