~/.vim/vimrc:
syntax on colorscheme empty
~/.vim/colors/empty.vim:
highlight clear if exists("syntax_on") syntax reset endif let g:colors_name="empty"
Save the following reStructuredText document to foo.rst:
**Bold** and *brash*
If foo.rst is opened in an environment in which bg=light, then the "Bold" text will be highlighted bold, and the "brash" text will be highlighted italic, as expected. However, if bg=dark upon opening the file, then no styling will be applied to the text.
The "Bold" and "brash" text should be highlighted bold & italic, respectively, regardless of whether bg is light or dark.
9.1.1800
OS: macOS Sonoma 14.7.8
Terminal: WezTerm 20240203-110809-5046fc22
TERM: xterm-256color
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
However, if bg=dark upon opening the file, then no styling will be applied to the text.
What does that mean? You set it after loading the colorscheme?
I think what is happening here is, that when the default background is set (which is light on most systems except for the Win32 console version), the highlighting isn't reset. But later setting the background will re-initialize the highlighting groups and therefore clear the existing highlighting groups.
Which means, if you do vim -u vimrc --noplugins --cmd 'set bg=dark' foo.rst the highlighting is correct even with a dark background.
I think this is just the way how colorschemes and highlighting works in combination with setting the background color.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
No, I mean that, if you are using a terminal that Vim autodetects as having a dark background, then no styling is applied. I'm not doing an explicit set bg=dark at any point.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Well this is probably the same thing. Switching the background option causes the highlighting groups to be reset
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #18540 as not planned.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I think we should probably rather make use of the new bold and italic highlighting groups, rather than setting those attributes directly as you already mentioned. Please open a new issue/PR when you noticed such a thing.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()