| To: vim-dev@vim.org |
| Subject: Patch 7.2.152 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.2.152 |
| Problem: When using "silent echo x" inside ":redir" a next echo may start |
| halfway the line. (Tony Mechelynck, Dennis Benzinger) |
| Solution: Reset msg_col after redirecting silently. |
| Files: src/ex_docmd.c, src/message.c, src/proto/message.pro |
| |
| |
| |
| |
| |
| *** 2699,2704 **** |
| --- 2699,2709 ---- |
| /* Restore msg_scroll, it's set by file I/O commands, even when no |
| * message is actually displayed. */ |
| msg_scroll = save_msg_scroll; |
| + |
| + /* "silent reg" or "silent echo x" inside "redir" leaves msg_col |
| + * somewhere in the line. Put it back in the first column. */ |
| + if (redirecting()) |
| + msg_col = 0; |
| } |
| |
| #ifdef HAVE_SANDBOX |
| |
| |
| |
| *** 3023,3033 **** |
| if (*p_vfile != NUL) |
| verbose_write(s, maxlen); |
| |
| ! if (redir_fd != NULL |
| ! #ifdef FEAT_EVAL |
| ! || redir_reg || redir_vname |
| ! #endif |
| ! ) |
| { |
| /* If the string doesn't start with CR or NL, go to msg_col */ |
| if (*s != '\n' && *s != '\r') |
| --- 3023,3029 ---- |
| if (*p_vfile != NUL) |
| verbose_write(s, maxlen); |
| |
| ! if (redirecting()) |
| { |
| /* If the string doesn't start with CR or NL, go to msg_col */ |
| if (*s != '\n' && *s != '\r') |
| |
| *** 3074,3079 **** |
| --- 3070,3085 ---- |
| } |
| } |
| |
| + int |
| + redirecting() |
| + { |
| + return redir_fd != NULL |
| + #ifdef FEAT_EVAL |
| + || redir_reg || redir_vname |
| + #endif |
| + ; |
| + } |
| + |
| /* |
| * Before giving verbose message. |
| * Must always be called paired with verbose_leave()! |
| |
| |
| |
| *** 54,59 **** |
| --- 54,60 ---- |
| void msg_clr_cmdline __ARGS((void)); |
| int msg_end __ARGS((void)); |
| void msg_check __ARGS((void)); |
| + int redirecting __ARGS((void)); |
| void verbose_enter __ARGS((void)); |
| void verbose_leave __ARGS((void)); |
| void verbose_enter_scroll __ARGS((void)); |
| |
| |
| |
| *** 678,679 **** |
| --- 678,681 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 152, |
| /**/ |
| |
| -- |
| Q: How does a UNIX Guru pick up a girl? |
| A: look; grep; which; eval; nice; uname; talk; date; |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |