Re: [vim/vim] Only set fgcolor while hlgroups is used on statusline if no bgcolor is set (Issue #20869)

h_east (Vim Github Repository) <[email protected]> Wed, 29 Jul 2026 10:03:56 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/issues/20869/[email protected]>
h-east left a comment (vim/vim#20869)

This is how it is meant to work.  In the statusline the highlight group
replaces the attribute, it is not combined with StatusLine, so a group without
a background has none and the one of Normal shows through.  The `%#HLname#`
item in `:help 'statusline'` says "The same highlighting is used", not that it
is merged.

Combining instead would also pull in the other attributes of StatusLine, bold
and reverse for instance, and would change the appearance for everyone using a
foreground-only group today.

Set the background explicitly if you want it.  Deriving it from StatusLine is a
common idiom in color schemes:

```vim
exe 'hi User1 guifg=green guibg='
      .. synIDattr(synIDtrans(hlID('StatusLine')), 'bg#', 'gui')
```

Closing as by design.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/20869#issuecomment-5121023429
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/issues/20869/[email protected]>

-- 
-- 
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].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/20869/5121023429%40github.com.