]> granicus.if.org Git - vim/commitdiff
patch 8.0.1546: using feedkeys() in a terminal may trigger mappings v8.0.1546
authorBram Moolenaar <Bram@vim.org>
Tue, 27 Feb 2018 15:29:28 +0000 (16:29 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 27 Feb 2018 15:29:28 +0000 (16:29 +0100)
Problem:    Using feedkeys() in a terminal window may trigger mappings.
            (Charles Sheridan)
Solution:   Avoid triggering a mapping when peeking for a key.

src/getchar.c
src/terminal.c
src/version.c

index 39ccebb64de91504a3d0ce94fc36a2faa0e06681..7025f67337d6100c0d2fbc0f0b7f1cb3d84032f4 100644 (file)
@@ -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.
index 867109b0796214dd4a51619b5e210cd4759ace6a..53591f15c9708068f513d32b3f0a0a96ee31bc81 100644 (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
  * 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. */
index 8f46214b7b81608aeb6d62be0ec84349d694e52e..af3baf581931c6f68333f133ca924dab90f98457 100644 (file)
@@ -778,6 +778,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1546,
 /**/
     1545,
 /**/