srcery-colors / srcery-vim

Srcery is a dark color scheme with clearly defined contrasting colors and a slightly earthy tone.
https://srcery.sh
Other
808 stars 60 forks source link

Colorscheme applied inconsistently #122

Open flaamjab opened 1 month ago

flaamjab commented 1 month ago

Hello.

I've been recently configuring syntax highlighting and noticed there are some inconsistencies depending on when the colorscheme is set. It seems to happen only with srcery specifically.

In Vim 8.2.2121 with the most basic config:

set number
set tabstop=4
set shiftwidth=4
set expandtab
set nowrap

packadd! srcery-vim
colorscheme srcery

I get the following highlights in a C file: 2024-06-06T12:06:45

If I call colorscheme srcery in the editor AFTER opening the C file the highlights change. 2024-06-06T12:06:07

I get the same behavior in Neovim 0.10 with only srcery-vim installed.

Some other filetypes are affected, netrw, for instance.

flaamjab commented 1 month ago

Now that I think about it, this behavior seems reasonable as there are some filetype-specific highlights set in the after directory. That's definitely unexpected though.

roosta commented 1 month ago

Hi, thanks for reporting. I think the issue is in this file, if I move those highlights to srcery.vim the issue is gone, seems those particular highlights can't be after it seems

roosta commented 1 month ago

hmm, got distracted by that particular file type because I was testing in my vimrc, which exhibited inconsistent color changes when I sourced it.

Like you said, this is probably related to the plugin folder structure after the refactor and how the syntax colors are loaded. Not sure it's something that can be addressed.

flaamjab commented 1 month ago

Alright then, I guess it's not much of an issue anyway.

MindTooth commented 1 month ago

Hi, thanks for reporting. I think the issue is in this file, if I move those highlights to srcery.vim the issue is gone, seems those particular highlights can't be after it seems

Is this some logic we should review again? The original pull request that added this was referring to dracula, but I can't see that they use that logic anymore. 🤔

Seems I commented a bit, but can't remember anything from it. 🤣

Ed1t: found some stuff from the Vim help, but didn't feel it really answered stuff. Says something about if you want to add to an existing syntax file, you use after. 🤔

roosta commented 4 weeks ago

Seems dracula has moved away from that file structure https://github.com/dracula/vim/pull/321 I think we should do the same. If it cause inconsistent colors and other issues it's not worth the few miliseconds of startup time we save.

I can look at it in a bit, got some time off next month, I'll try and publish a PR to fix it.

roosta commented 4 weeks ago

ref: https://github.com/dracula/vim/issues/280