Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug when switching colorschemes #2273

Closed
lifepillar opened this issue Nov 1, 2017 · 2 comments
Closed

Possible bug when switching colorschemes #2273

lifepillar opened this issue Nov 1, 2017 · 2 comments

Comments

@lifepillar
Copy link
Contributor

lifepillar commented Nov 1, 2017

As you are probably aware, there is a long-standing issue causing syntax highlighting to be messed up when switching between colorschemes that define highlight groups for syntax items (see, for example, altercation/solarized#102).

Such issue doesn't seem easy to solve, since (see :h hi-default), Vim offers the possibility to override syntax highlight groups in one's own vimrc, and it seems reasonable to assume that such commands should be persistent across colorscheme changes (or should they?), which is at odds with the idea of including such commands in colorschemes (where the reasonable behaviour is that their effects are wiped out when the colorscheme changes). In practice, many colorschemes define highlighting for syntax items, so it would be nice if that didn't cause issues. I don't know whether you consider this something that should or might be addressed by Vim (maybe, your opinion is that people are misusing colorschemes).

However, I'd like to report the following, which does look like a bug to me. Consider this test-vimrc defining three custom highlight groups:

syntax on
hi NormalMode ctermfg=0 ctermbg=15
hi InsertMode ctermfg=0 ctermbg=15
hi Foobar ctermfg=0 ctermbg=15

Execute vim -i NONE -u test-vimrc -N. Then, switch to the default colorscheme and look how the highlight groups are defined:

:hi NormalMode
:hi InsertMode
:hi Foobar

That's the output:

NormalMode     xxx links to StatusLine
InsertMode     xxx links to DiffText
Foobar         xxx cleared

Edit: added missing command.

@lifepillar
Copy link
Contributor Author

Sorry, I have forgotten a syntax on in the vimrc. I have updated my previous comment.

@lifepillar
Copy link
Contributor Author

lifepillar commented Nov 1, 2017

Ah, never mind, syntax on reads inside my .vim folder, that's why I get inconsistent clearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant