comparison src/getchar.c @ 3231:910eb66c9768 v7.3.385

updated for version 7.3.385 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.
author Bram Moolenaar <bram@vim.org>
date Fri, 23 Dec 2011 14:54:04 +0100
parents 7919a3d7333b
children 320cc46d0eb0
comparison
equal deleted inserted replaced
3230:343a5861e267 3231:910eb66c9768
4508 char_u *res; 4508 char_u *res;
4509 char_u *p; 4509 char_u *p;
4510 char_u *expr; 4510 char_u *expr;
4511 char_u *save_cmd; 4511 char_u *save_cmd;
4512 pos_T save_cursor; 4512 pos_T save_cursor;
4513 int save_msg_col;
4514 int save_msg_row;
4513 4515
4514 /* Remove escaping of CSI, because "str" is in a format to be used as 4516 /* Remove escaping of CSI, because "str" is in a format to be used as
4515 * typeahead. */ 4517 * typeahead. */
4516 expr = vim_strsave(str); 4518 expr = vim_strsave(str);
4517 if (expr == NULL) 4519 if (expr == NULL)
4531 #ifdef FEAT_EX_EXTRA 4533 #ifdef FEAT_EX_EXTRA
4532 ++ex_normal_lock; 4534 ++ex_normal_lock;
4533 #endif 4535 #endif
4534 set_vim_var_char(c); /* set v:char to the typed character */ 4536 set_vim_var_char(c); /* set v:char to the typed character */
4535 save_cursor = curwin->w_cursor; 4537 save_cursor = curwin->w_cursor;
4538 save_msg_col = msg_col;
4539 save_msg_row = msg_row;
4536 p = eval_to_string(expr, NULL, FALSE); 4540 p = eval_to_string(expr, NULL, FALSE);
4537 --textlock; 4541 --textlock;
4538 #ifdef FEAT_EX_EXTRA 4542 #ifdef FEAT_EX_EXTRA
4539 --ex_normal_lock; 4543 --ex_normal_lock;
4540 #endif 4544 #endif
4541 curwin->w_cursor = save_cursor; 4545 curwin->w_cursor = save_cursor;
4546 msg_col = save_msg_col;
4547 msg_row = save_msg_row;
4542 4548
4543 restore_cmdline_alloc(save_cmd); 4549 restore_cmdline_alloc(save_cmd);
4544 vim_free(expr); 4550 vim_free(expr);
4545 4551
4546 if (p == NULL) 4552 if (p == NULL)