diff options
author | Bram Moolenaar <bram@vim.org> | 2011-12-23 14:54:04 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2011-12-23 14:54:04 +0100 |
commit | f8e69cf7ef163aa5940b8c223a2633f1705ffed5 (patch) | |
tree | 55a09655aaca0be80871e3daaba2d4ca80e05622 | |
parent | 23b7f64071cdca982dbb750dda3eb4c563cbb618 (diff) | |
download | vim-f8e69cf7ef163aa5940b8c223a2633f1705ffed5.tar.gz |
Problem: When using an expression mapping on the command line the cursor
ends up in the wrong place. (Yasuhiro Matsumoto)
Solution: Save and restore msg_col and msg_row when evaluating the
expression.
-rw-r--r-- | src/getchar.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/getchar.c b/src/getchar.c index a895483a..c4457c4f 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -4510,6 +4510,8 @@ eval_map_expr(str, c) char_u *expr; char_u *save_cmd; pos_T save_cursor; + int save_msg_col; + int save_msg_row; /* Remove escaping of CSI, because "str" is in a format to be used as * typeahead. */ @@ -4533,12 +4535,16 @@ eval_map_expr(str, c) #endif set_vim_var_char(c); /* set v:char to the typed character */ save_cursor = curwin->w_cursor; + save_msg_col = msg_col; + save_msg_row = msg_row; p = eval_to_string(expr, NULL, FALSE); --textlock; #ifdef FEAT_EX_EXTRA --ex_normal_lock; #endif curwin->w_cursor = save_cursor; + msg_col = save_msg_col; + msg_row = save_msg_row; restore_cmdline_alloc(save_cmd); vim_free(expr); diff --git a/src/version.c b/src/version.c index e57a4cf7..4e40bb3f 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 385, +/**/ 384, /**/ 383, |