summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-30 18:54:39 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-30 18:54:39 +0000
commitc9b4b05b3544b434730eb218e848a1a441d5ffb2 (patch)
treec1550ddf398d2030ed25ee98e8342fcb41ac1c87 /src/getchar.c
parentaa35dd1667c5903cdcc32ebe10f27bc6683c68a1 (diff)
updated for version 7.0gv7.0g
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 3b9d42014b..88e724ff31 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4335,11 +4335,26 @@ eval_map_expr(str)
char_u *res;
char_u *p;
char_u *save_cmd;
+ pos_T save_cursor;
save_cmd = save_cmdline_alloc();
if (save_cmd == NULL)
return NULL;
+
+ /* Forbid changing text or using ":normal" to avoid most of the bad side
+ * effects. Also restore the cursor position. */
+ ++textlock;
+#ifdef FEAT_EX_EXTRA
+ ++ex_normal_lock;
+#endif
+ save_cursor = curwin->w_cursor;
p = eval_to_string(str, NULL, FALSE);
+ --textlock;
+#ifdef FEAT_EX_EXTRA
+ --ex_normal_lock;
+#endif
+ curwin->w_cursor = save_cursor;
+
restore_cmdline_alloc(save_cmd);
if (p == NULL)
return NULL;