Skip to content

Commit 043093f

Browse files
authored
Merge pull request #43 from roachsinai/fix_colorless
Fix the quickui menu become colorless after use command like: colorsc…
2 parents b5b472a + 8403286 commit 043093f

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

plugin/quickui.vim

+14-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"======================================================================
22
"
3-
" quickui.vim -
3+
" quickui.vim -
44
"
55
" Created by skywind on 2019/12/26
66
" Last Modified: 2019/12/26 18:20:52
@@ -29,17 +29,18 @@ let s:rtp = fnamemodify(s:home, ':h')
2929
"----------------------------------------------------------------------
3030
let g:quickui#style#border = get(g:, 'quickui_border_style', 1)
3131

32-
33-
"----------------------------------------------------------------------
34-
" default highlighting
35-
"----------------------------------------------------------------------
36-
function! s:hilink(name, target)
37-
if !hlexists(a:name)
38-
exec 'hi! link ' . a:name . ' ' . a:target
39-
endif
32+
function! s:set_quickui_hi()
33+
" hi! QuickDefaultSel ctermbg=
34+
hi! link QuickBG QuickDefaultBackground
35+
hi! link QuickSel QuickDefaultSel
36+
hi! link QuickKey QuickDefaultKey
37+
hi! link QuickOff QuickDefaultDisable
38+
hi! link QuickHelp QuickDefaultHelp
39+
hi! link QuickBorder QuickDefaultBorder
40+
hi! link QuickTermBorder QuickDefaultTermBorder
41+
hi! link QuickPreview QuickDefaultPreview
4042
endfunc
4143

42-
4344
function! QuickThemeChange(theme)
4445
let theme = 'borland'
4546
if a:theme == 'default'
@@ -52,7 +53,7 @@ function! QuickThemeChange(theme)
5253
let theme = 'gruvbox'
5354
elseif a:theme == 'solarized'
5455
let theme = 'solarized'
55-
elseif a:theme == 'papercol' || a:theme == 'papercol-dark'
56+
elseif a:theme == 'papercol' || a:theme == 'papercol-dark'
5657
let theme = 'papercol_dark'
5758
elseif a:theme == 'papercol dark'
5859
let theme = 'papercol_dark'
@@ -68,6 +69,7 @@ function! QuickThemeChange(theme)
6869
if filereadable(s:fname)
6970
exec "source " . fnameescape(s:fname)
7071
endif
72+
call s:set_quickui_hi()
7173
endfunc
7274

7375
let s:scheme = get(g:, 'quickui_color_scheme', '')
@@ -78,14 +80,4 @@ augroup quickui "{{{
7880
autocmd Colorscheme * call QuickThemeChange(get(g:, 'quickui_color_scheme', ''))
7981
augroup END "}}}
8082

81-
" hi! QuickDefaultSel ctermbg=
82-
call s:hilink('QuickBG', 'QuickDefaultBackground')
83-
call s:hilink('QuickSel', 'QuickDefaultSel')
84-
call s:hilink('QuickKey', 'QuickDefaultKey')
85-
call s:hilink('QuickOff', 'QuickDefaultDisable')
86-
call s:hilink('QuickHelp', 'QuickDefaultHelp')
87-
call s:hilink('QuickBorder', 'QuickDefaultBorder')
88-
call s:hilink('QuickTermBorder', 'QuickDefaultTermBorder')
89-
call s:hilink('QuickPreview', 'QuickDefaultPreview')
90-
91-
83+
call s:set_quickui_hi()

0 commit comments

Comments
 (0)