summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-27 16:29:28 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-27 16:29:28 +0100
commitc8bcfe7efd4cfdfd7f503700aba45c42765cd4dc (patch)
tree78ad672bf27e47c47315297818a06be29dae831e
parent8226ac6b5916c736dde751df9cb8d03c19cb5611 (diff)
patch 8.0.1546: using feedkeys() in a terminal may trigger mappingsv8.0.1546
Problem: Using feedkeys() in a terminal window may trigger mappings. (Charles Sheridan) Solution: Avoid triggering a mapping when peeking for a key.
-rw-r--r--src/getchar.c2
-rw-r--r--src/terminal.c5
-rw-r--r--src/version.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 39ccebb64d..7025f67337 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1854,7 +1854,7 @@ vpeekc(void)
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
* codes.
diff --git a/src/terminal.c b/src/terminal.c
index 867109b079..53591f15c9 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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
* closed and ++close was used.
- * Uses terminal mode mappings.
*/
static int
term_vgetc()
@@ -1633,7 +1632,7 @@ terminal_loop(int blocking)
position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
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. */
/* Repeat redrawing in case a message is received while redrawing. */
diff --git a/src/version.c b/src/version.c
index 8f46214b7b..af3baf5819 100644
--- a/src/version.c
+++ b/src/version.c
@@ -779,6 +779,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1546,
+/**/
1545,
/**/
1544,