diff options
author | Vadim A. Misbakh-Soloviov <msva@users.noreply.github.com> | 2018-03-25 20:45:02 +0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-03-25 15:45:02 +0200 |
commit | 9ebe2ad3312088d1a899e830bd414d4893c3e073 (patch) | |
tree | 68ef57fa6a551dd096766716e64797deb68f27d4 | |
parent | f8d2aef4f20887bb5a407b5a34cd5dc29fc6771c (diff) | |
download | rneovim-9ebe2ad3312088d1a899e830bd414d4893c3e073.tar.gz rneovim-9ebe2ad3312088d1a899e830bd414d4893c3e073.tar.bz2 rneovim-9ebe2ad3312088d1a899e830bd414d4893c3e073.zip |
runtime/dircolors.vim: support termguicolors (#8175)
-rw-r--r-- | runtime/syntax/dircolors.vim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/syntax/dircolors.vim b/runtime/syntax/dircolors.vim index 1b598c39b5..3d7f63dc55 100644 --- a/runtime/syntax/dircolors.vim +++ b/runtime/syntax/dircolors.vim @@ -32,7 +32,7 @@ syntax match dircolorsEscape '\\[abefnrtv?_\\^#]' syntax match dircolorsEscape '\\[0-9]\{3}' syntax match dircolorsEscape '\\x[0-9a-f]\{3}' -if !has('gui_running') && &t_Co == '' +if !(has('gui_running') || &termguicolors) && &t_Co == '' syntax match dircolorsNumber '\<\d\+\>' highlight default link dircolorsNumber Number endif @@ -84,7 +84,7 @@ endfunction function! s:get_hi_str(color, place) abort if a:color >= 0 && a:color <= 255 - if has('gui_running') + if has('gui_running') || &termguicolors return ' gui' . a:place . '=' . s:termguicolors[a:color] elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88 return ' cterm' . a:place . '=' . a:color @@ -169,7 +169,7 @@ function! s:preview_color(linenr) abort \ ' "\_s\zs' . colordef . '\ze\_s"' let hi_attrs_str = '' if !empty(hi_attrs) - if has('gui_running') + if has('gui_running') || &termguicolors let hi_attrs_str = ' gui=' . join(hi_attrs, ',') else let hi_attrs_str = ' cterm=' . join(hi_attrs, ',') @@ -199,11 +199,11 @@ endfunction let b:dc_next_index = 0 -if has('gui_running') +if has('gui_running') || &termguicolors call s:set_guicolors() endif -if has('gui_running') || &t_Co != '' +if has('gui_running') || &termguicolors || &t_Co != '' call s:reset_colors() autocmd CursorMoved,CursorMovedI <buffer> call s:preview_color('.') |