Hi,
here is a bug in the highlighting of the statusline, when using group 
items:

:set laststatus=2
:let &stl='+foobar+'
(shows "+foobar+"
-> is okay)
:let &stl='+%(foobar%)+'
(shows "+foobar+"
-> is okay)
:let &stl='+%(%#ErrorMsg#foobar%)+'
(shows "++", everything after the second + with error highlighting
-> not okay)
:let &stl='+%(%#WildMenu#««««««%#Normal#%)-%#Statusline#
(shows "+-+          +", starting with the '-' until the third '+' 
everything highlighted with WildMenu highlighting
-> not okay)

Screenshots available here:
https://i.imgur.com/n7Sa1gr.png

This is a problem for statusline highlighter plugins, since the colors 
leak from one section to the next and make it hard to reproduce. I just 
found this problem per accident today, when I wanted to fix another bug 
in vim-airline.

This patch fixes it:
diff --git a/src/buffer.c b/src/buffer.c
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3723,7 +3723,7 @@ build_stl_str_hl(
            {
                /* remove group if all items are empty */
                for (n = groupitem[groupdepth] + 1; n < curitem; n++)
-                   if (item[n].type == Normal)
+                   if (item[n].type == Normal || item[n].type == Highlight)
                        break;
                if (n == curitem)
                {


Best,
Christian
-- 
1,9 Prozent sind rechnerisch gesehen auch noch rund zwei Prozent.
                -- Bernd Pfaffenbach
(Chefökonom des Bundeskanzleramtes, in der »Börsen-Zeitung« zu den
Aussichten für die Konjunktur in Deutschland)

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui