Ken Hamada wrote:

> Hi list. I found a strange behavior of fillchars and StatusLine.
> 
> vim -u NONE --cmd 'set fillchars=stl:\ ,stlnc:\ ' --cmd 'vnew'
> I set both stl and stlnc space so that I don't see any ^ or = characters in 
> the statusline.
> But when I set the following highlights, Vim draws the statusline of the 
> current window with ^.
> 
> hi StatusLine ctermbg=8 ctermfg=7 cterm=NONE guibg=NONE guifg=NONE gui=NONE
> hi StatusLineNC ctermbg=8 ctermfg=7 cterm=NONE guibg=NONE guifg=NONE gui=NONE
> 
> I set both spaces in fillchars so I expect them applied regardless of 
> highlight configurations.
> Setting ctermfg=15 for StatusLine (I mean, make differences between the 
> highlights),
> Vim respects the value of fillchars again.
> 
> Apparently this behavior comes from 
> https://github.com/vim/vim/blob/4c8980b717f73042f1d625ee255fa74eddb989ba/src/screen.c#L10535-L10540.
> When stl and stlnc are same and StatusLine and StatusLineNC are same, the 
> fill characters falls back to the defaults.
> The help only mentions the case when there is highlighting or not.
> The current behavior is not intuitive to me.
> 
> diff --git a/src/screen.c b/src/screen.c
> index ee61a01..17f72cd 100644
> --- a/src/screen.c
> +++ b/src/screen.c
> @@ -10532,12 +10532,8 @@ fillchar_status(int *attr, int is_curwin)
>       *attr = hl_attr(HLF_SNC);
>       fill = fill_stlnc;
>      }
> -    /* Use fill when there is highlighting, and highlighting of current
> -     * window differs, or the fillchars differ, or this is not the
> -     * current window */
> -    if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC)
> -                     || !is_curwin || ONE_WINDOW)
> -                 || (fill_stl != fill_stlnc)))
> +    /* Use fill when there is highlighting. */
> +    if (*attr != 0)
>       return fill;
>      if (is_curwin)
>       return '^';
> 
> 
> What do you think?

The problem is that the default is that both fill characters are a
space.  I think the best would be to check if the 'fillchar' option
specifies the value.  If so, respect it, otherwise use the default as
before.

-- 
hundred-and-one symptoms of being an internet addict:
98. The Alta Vista administrators ask you what sites are missing
    in their index files.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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