Mercurial > vim
changeset 3020:92167bb91c95 v7.3.282
updated for version 7.3.282
Problem: When using input() and :echo in a loop the displayed text is
incorrect. (Benjamin Fritz)
Solution: Only restore the cursor position when there is a command line.
(Ben Schmidt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 17 Aug 2011 16:25:48 +0200 |
parents | 235254a1a34c |
children | 0f3a5589de8a |
files | src/ex_getln.c src/version.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1969,8 +1969,12 @@ getcmdline_prompt(firstc, prompt, attr, # endif s = getcmdline(firstc, 1L, 0); restore_cmdline(&save_ccline); - /* Restore msg_col, the prompt from input() may have changed it. */ - msg_col = msg_col_save; + /* Restore msg_col, the prompt from input() may have changed it. + * But only if called recursively and the commandline is therefore being + * restored to an old one; if not, the input() prompt stays on the screen, + * so we need its modified msg_col left intact. */ + if (ccline.cmdbuff != NULL) + msg_col = msg_col_save; return s; }