diff options
author | Gregory Anders <greg@gpanders.com> | 2021-06-10 21:59:10 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2021-07-14 20:51:36 -0600 |
commit | 0bcf96bf0bf1136aa4fb09dd86461312a2bc4fbb (patch) | |
tree | 06ffc31719bcd3097efa81180549eb65dff8497e /runtime/lua/vim/treesitter/query.lua | |
parent | 682247b52e76180e4c49b794c6cc2548bfd32d4c (diff) | |
download | rneovim-0bcf96bf0bf1136aa4fb09dd86461312a2bc4fbb.tar.gz rneovim-0bcf96bf0bf1136aa4fb09dd86461312a2bc4fbb.tar.bz2 rneovim-0bcf96bf0bf1136aa4fb09dd86461312a2bc4fbb.zip |
fix: source syncolors.vim before startup scripts
This fixes an issue (#12573) where colorscheme files are sourced twice
upon startup. This occurs when the startup script calls `:colorscheme`,
which sets the `g:colors_name` global variable. When syntax highlighting
is enabled in `syn_maybe_enable()` the `syntax.vim` script is sourced
which in turn sources `synload.vim`. This script checks to see if
`g:colors_name` is set and, if so, runs
exe "colors " . colors_name
This is done to ensure that highlight groups are defined before enabling
the syntax highlighting engine.
Instead, source syncolors.vim before the startup scripts which sets up
default highlights and only load the full syntax engine after
the startup scripts or when the user runs `:syntax on`. Add a guard
variable `did_syncolor` to prevent syncolor.vim from being sourced
twice and remove the line mentioned above from synload.vim so that
the colorscheme file is not re-sourced when the syntax engine is loaded.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
0 files changed, 0 insertions, 0 deletions