aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudit Novak <judit.novak@canonical.com>2025-01-28 17:17:37 +0100
committerGitHub <noreply@github.com>2025-01-28 08:17:37 -0800
commitcb924764a40deea7e9c94fc60eac144e318a6f16 (patch)
tree4307cd3b300c32d7d958e7d33796059cfe9a6a97
parent318676ad13483fa1f9b2733d6915620f2525ca12 (diff)
downloadrneovim-cb924764a40deea7e9c94fc60eac144e318a6f16.tar.gz
rneovim-cb924764a40deea7e9c94fc60eac144e318a6f16.tar.bz2
rneovim-cb924764a40deea7e9c94fc60eac144e318a6f16.zip
fix(runtime): "E121 Undefined variable s:termguicolors" #32209
Problem: dircolors syntaxt termguicolors support was not taking dynamic termguicolors changes into account. Solution: initializing missing script-internal data on dynamic termguicolors change.
-rw-r--r--runtime/syntax/dircolors.vim3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/syntax/dircolors.vim b/runtime/syntax/dircolors.vim
index 74a7068488..d968ed8fdd 100644
--- a/runtime/syntax/dircolors.vim
+++ b/runtime/syntax/dircolors.vim
@@ -85,6 +85,9 @@ endfunction
function! s:get_hi_str(color, place) abort
if a:color >= 0 && a:color <= 255
if has('gui_running') || &termguicolors
+ if ! exists("s:termguicolors")
+ call s:set_guicolors()
+ endif
return ' gui' . a:place . '=' . s:termguicolors[a:color]
elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88
return ' cterm' . a:place . '=' . a:color