mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-21 11:22:34 -05:00
Only check the term type for colors once rather than for each declaration, and when gui/termguicolors is not set then "set notermguicolors" should be run to get cterm colors working again in neovim 0.10+
This commit is contained in:
parent
5b5bfc3e96
commit
6d88ffd6a6
2 changed files with 16 additions and 14 deletions
|
@ -19,30 +19,32 @@ endif
|
|||
"declare the name of our theme
|
||||
let colors_name = "darkcloud"
|
||||
|
||||
"sets the highlighting for the given group | format: s:C("Name","Foreground","Background","Style")
|
||||
fun! s:C(group, fg, bg, attr)
|
||||
"declare the term type
|
||||
if has("gui_running") || &termguicolors
|
||||
let l:term = "gui"
|
||||
let g:term_colors_type = "gui"
|
||||
else
|
||||
let l:term = "cterm"
|
||||
set notermguicolors "required to use cterm colors
|
||||
let g:term_colors_type = "cterm"
|
||||
endif
|
||||
|
||||
"sets the highlighting for the given group | format: s:C("Name","Foreground","Background","Style")
|
||||
fun! s:C(group, fg, bg, attr)
|
||||
if a:fg != ""
|
||||
exec "hi " . a:group . " " . l:term . "fg=" . a:fg
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "fg=" . a:fg
|
||||
else
|
||||
exec "hi " . a:group . " " . l:term . "fg=NONE"
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "fg=NONE"
|
||||
endif
|
||||
|
||||
if a:bg != ""
|
||||
exec "hi " . a:group . " " . l:term . "bg=" . a:bg
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "bg=" . a:bg
|
||||
else
|
||||
exec "hi " . a:group . " " . l:term . "bg=NONE"
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "bg=NONE"
|
||||
endif
|
||||
|
||||
if a:attr != ""
|
||||
exec "hi " . a:group . " " . l:term . "=" . a:attr
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "=" . a:attr
|
||||
else
|
||||
exec "hi " . a:group . " " . l:term . "=NONE"
|
||||
exec "hi " . a:group . " " . g:term_colors_type . "=NONE"
|
||||
endif
|
||||
endfun
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if has("gui_running") || &termguicolors
|
||||
if has("gui_running") || &term != "linux" && &termguicolors
|
||||
let g:cBlack = '#000000'
|
||||
let g:cWhite = '#ffffff'
|
||||
|
||||
|
@ -17,7 +17,7 @@ if has("gui_running") || &termguicolors
|
|||
|
||||
let g:cLightBg = '#303030'
|
||||
let g:cDarkBg = '#262626'
|
||||
elseif &term != "linux" && &t_Co >= 256
|
||||
elseif &t_Co >= 256 && &term != "linux"
|
||||
let g:cBlack = '0' "#000000
|
||||
let g:cWhite = '15' "#ffffff
|
||||
|
||||
|
|
Loading…
Reference in a new issue