changeset 3135:7919a3d7333b v7.3.338

updated for version 7.3.338 Problem: Using getchar() in an expression mapping doesn't work well. Solution: Don't save and restore the typeahead. (James Vega)
author Bram Moolenaar <bram@vim.org>
date Wed, 12 Oct 2011 22:02:14 +0200
parents e8f3119f5d09
children f530aef0d959
files src/getchar.c src/testdir/test34.ok src/version.c
diffstat 3 files changed, 10 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2460,27 +2460,18 @@ vgetorpeek(advance)
 
 			/*
 			 * Handle ":map <expr>": evaluate the {rhs} as an
-			 * expression.  Save and restore the typeahead so that
-			 * getchar() can be used.  Also save and restore the
-			 * command line for "normal :".
+			 * expression.  Also save and restore the command line
+			 * for "normal :".
 			 */
 			if (mp->m_expr)
 			{
-			    tasave_T	tabuf;
 			    int		save_vgetc_busy = vgetc_busy;
 
-			    save_typeahead(&tabuf);
-			    if (tabuf.typebuf_valid)
-			    {
-				vgetc_busy = 0;
-				save_m_keys = vim_strsave(mp->m_keys);
-				save_m_str = vim_strsave(mp->m_str);
-				s = eval_map_expr(save_m_str, NUL);
-				vgetc_busy = save_vgetc_busy;
-			    }
-			    else
-				s = NULL;
-			    restore_typeahead(&tabuf);
+			    vgetc_busy = 0;
+			    save_m_keys = vim_strsave(mp->m_keys);
+			    save_m_str = vim_strsave(mp->m_str);
+			    s = eval_map_expr(save_m_str, NUL);
+			    vgetc_busy = save_vgetc_busy;
 			}
 			else
 #endif
--- a/src/testdir/test34.ok
+++ b/src/testdir/test34.ok
@@ -1,5 +1,5 @@
 xxx4asdf fail nop ok 9 333
-XX111XX
+XX111-XX
 ---222---
 1. one
 2. two
--- a/src/version.c
+++ b/src/version.c
@@ -710,6 +710,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    338,
+/**/
     337,
 /**/
     336,