Hi, bram and list.

Try following.

    set verbosefile=foo
    silent highlight

I can see broken columns in verbosefile 'foo'.
-------
SpecialKey     xxx term=boldctermfg=9guifg=Cyan
                    NonTextxxx term=boldctermfg=9gui=boldguifg=Blue
                        Directoryxxx term=boldctermfg=11guifg=Cyan
                           ErrorMsgxxx 
term=standoutctermfg=15ctermbg=4guifg=Whiteguibg=Red
                                IncSearchxxx 
term=reversecterm=reversegui=reverse
                                   Searchxxx 
term=reversectermfg=0ctermbg=12gui=boldguifg=Blackguibg=Red
                                         MoreMsgxxx 
term=boldctermfg=10gui=boldguifg=SeaGreen
                                             ModeMsgxxx 
term=boldcterm=boldgui=bold
                                                LineNrxxx 
term=underlinectermfg=14guifg=Yellow
                                                   Questionxxx 
term=standoutctermfg=10gui=boldguifg=Green
                                                       StatusLinexxx 
term=bold,reversecterm=bold,reversectermfg=9ctermbg=15gui=bold,reverseguifg=blueguibg=white
...
-------

This cause is that do_one_cmd() set msg_col = 0 only when redirecting() == 
TRUE.
I think that most part of writing messages should become similar to 
":redir"'s part.
I removed verbose_write() and merged the part of verbose_write() in 
redir_write().

https://raw.github.com/gist/ca50d8b0084e980371ec/gistfile1

This seems working fine. Please check.

Thanks.
- Yasuhiro Matsumoto

diff -r ba9f075a347d src/message.c
--- a/src/message.c     Sun Aug 28 16:02:28 2011 +0200
+++ b/src/message.c     Thu Sep 08 15:49:48 2011 +0900
@@ -39,7 +39,6 @@
 static void msg_screen_putchar __ARGS((int c, int attr));
 static int  msg_check_screen __ARGS((void));
 static void redir_write __ARGS((char_u *s, int maxlen));
-static void verbose_write __ARGS((char_u *s, int maxlen));
 #ifdef FEAT_CON_DIALOG
 static char_u *msg_show_console_dialog __ARGS((char_u *message, char_u 
*buttons, int dfltbutton));
 static int     confirm_msg_used = FALSE;       /* displaying confirm_msg */
@@ -58,6 +57,9 @@
 static struct msg_hist *last_msg_hist = NULL;
 static int msg_hist_len = 0;
 
+static FILE *verbose_fd = NULL;
+static int  verbose_did_open = FALSE;
+
 /*
  * When writing messages to the screen, there are many different situations.
  * A number of variables is used to remember the current state:
@@ -3065,12 +3067,9 @@
     if (redir_off)
        return;
 
-    /*
-     * If 'verbosefile' is set write message in that file.
-     * Must come before the rest because of updating "msg_col".
-     */
-    if (*p_vfile != NUL)
-       verbose_write(s, maxlen);
+    /* If 'verbosefile' is set write message in that file. */
+    if (*p_vfile != NUL && verbose_fd == NULL)
+       verbose_open();
 
     if (redirecting())
     {
@@ -3087,6 +3086,8 @@
                else if (redir_fd)
 #endif
                    fputs(" ", redir_fd);
+               if (verbose_fd)
+                   fputs(" ", verbose_fd);
                ++cur_col;
            }
        }
@@ -3105,6 +3106,8 @@
            if (!redir_reg && !redir_vname && redir_fd != NULL)
 #endif
                putc(*s, redir_fd);
+           if (verbose_fd != NULL)
+               putc(*s, verbose_fd);
            if (*s == '\r' || *s == '\n')
                cur_col = 0;
            else if (*s == '\t')
@@ -3122,7 +3125,7 @@
     int
 redirecting()
 {
-    return redir_fd != NULL
+    return redir_fd != NULL || verbose_fd != NULL
 #ifdef FEAT_EVAL
                          || redir_reg || redir_vname
 #endif
@@ -3180,9 +3183,6 @@
        cmdline_row = msg_row;
 }
 
-static FILE *verbose_fd = NULL;
-static int  verbose_did_open = FALSE;
-
 /*
  * Called when 'verbosefile' is set: stop writing to the file.
  */
@@ -3220,49 +3220,6 @@
 }
 
 /*
- * Write a string to 'verbosefile'.
- * When "maxlen" is -1 write the whole string, otherwise up to "maxlen" bytes.
- */
-    static void
-verbose_write(str, maxlen)
-    char_u     *str;
-    int                maxlen;
-{
-    char_u     *s = str;
-    static int cur_col = 0;
-
-    /* Open the file when called the first time. */
-    if (verbose_fd == NULL)
-       verbose_open();
-
-    if (verbose_fd != NULL)
-    {
-       /* If the string doesn't start with CR or NL, go to msg_col */
-       if (*s != '\n' && *s != '\r')
-       {
-           while (cur_col < msg_col)
-           {
-               fputs(" ", verbose_fd);
-               ++cur_col;
-           }
-       }
-
-       /* Adjust the current column */
-       while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
-       {
-           putc(*s, verbose_fd);
-           if (*s == '\r' || *s == '\n')
-               cur_col = 0;
-           else if (*s == '\t')
-               cur_col += (8 - cur_col % 8);
-           else
-               ++cur_col;
-           ++s;
-       }
-    }
-}
-
-/*
  * Give a warning message (for searching).
  * Use 'w' highlighting and may repeat the message after redrawing
  */


-- 
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

Raspunde prin e-mail lui