srcery-vim icon indicating copy to clipboard operation
srcery-vim copied to clipboard

Colorscheme applied inconsistently

Open flaamjab opened this issue 1 year ago • 7 comments

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 avatar Jun 06 '24 09:06 flaamjab

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.

flaamjab avatar Jun 06 '24 09:06 flaamjab

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 avatar Jun 06 '24 10:06 roosta

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.

roosta avatar Jun 06 '24 14:06 roosta

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

flaamjab avatar Jun 08 '24 13:06 flaamjab

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

MindTooth avatar Jun 08 '24 14:06 MindTooth

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 avatar Jun 10 '24 13:06 roosta

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

roosta avatar Jun 10 '24 13:06 roosta