Hi. Try following on windows.
---- script1 ---- function! DoSpace() return ' ' endfunction cnoremap <expr> <space> DoSpace() ---- ---- script2 ---- function! DoSpace() redir => foo silent! command redir END return ' ' endfunction cnoremap <expr> <space> DoSpace() ---- When run script1 and type ":XXX " in normal mode, you'll see ":XXX ". But if run script2 and type it, it show " XXX ". You can see ":" is erased in command line. The cause is: Doing redir and something that updating cursor position in scripts are change msg_col even if command use silent!. This is not a problem. But if enter "redir END" for <expr> function, msg_col should be restored to original position that is started with ":redir foo". Below is a patch. Please check this. https://gist.github.com/1219080 diff -r 15b934a16641 src/ex_docmd.c --- a/src/ex_docmd.c Wed Sep 14 19:04:40 2011 +0200 +++ b/src/ex_docmd.c Thu Sep 15 20:43:11 2011 +0900 @@ -8628,9 +8628,13 @@ char *mode; char_u *fname; char_u *arg = eap->arg; + static int save_msg_col = 0; if (STRICMP(eap->arg, "END") == 0) + { close_redir(); + msg_col = save_msg_col; + } else { if (*arg == '>') @@ -8736,8 +8740,10 @@ #ifdef FEAT_EVAL || redir_reg || redir_vname #endif - ) + ) { redir_off = FALSE; + save_msg_col = msg_col; + } } /* -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
