From 24dc65549c933892d4c1fae75ee34fda2dd315ed Mon Sep 17 00:00:00 2001 From: roachsinai Date: Wed, 14 Oct 2020 21:46:33 +0800 Subject: [PATCH 1/2] Fix the quickui menu become colorless after use command like: colorscheme, set bg. --- plugin/quickui.vim | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/plugin/quickui.vim b/plugin/quickui.vim index 04d98fd..5ed6b35 100644 --- a/plugin/quickui.vim +++ b/plugin/quickui.vim @@ -1,6 +1,6 @@ "====================================================================== " -" quickui.vim - +" quickui.vim - " " Created by skywind on 2019/12/26 " Last Modified: 2019/12/26 18:20:52 @@ -39,6 +39,17 @@ function! s:hilink(name, target) endif endfunc +function! s:set_quickui_hi() + " hi! QuickDefaultSel ctermbg= + hi! link QuickBG QuickDefaultBackground + hi! link QuickSel QuickDefaultSel + hi! link QuickKey QuickDefaultKey + hi! link QuickOff QuickDefaultDisable + hi! link QuickHelp QuickDefaultHelp + hi! link QuickBorder QuickDefaultBorder + hi! link QuickTermBorder QuickDefaultTermBorder + hi! link QuickPreview QuickDefaultPreview +endfunc function! QuickThemeChange(theme) let theme = 'borland' @@ -52,7 +63,7 @@ function! QuickThemeChange(theme) let theme = 'gruvbox' elseif a:theme == 'solarized' let theme = 'solarized' - elseif a:theme == 'papercol' || a:theme == 'papercol-dark' + elseif a:theme == 'papercol' || a:theme == 'papercol-dark' let theme = 'papercol_dark' elseif a:theme == 'papercol dark' let theme = 'papercol_dark' @@ -68,6 +79,7 @@ function! QuickThemeChange(theme) if filereadable(s:fname) exec "source " . fnameescape(s:fname) endif + call s:set_quickui_hi() endfunc let s:scheme = get(g:, 'quickui_color_scheme', '') @@ -78,14 +90,4 @@ augroup quickui "{{{ autocmd Colorscheme * call QuickThemeChange(get(g:, 'quickui_color_scheme', '')) augroup END "}}} -" hi! QuickDefaultSel ctermbg= -call s:hilink('QuickBG', 'QuickDefaultBackground') -call s:hilink('QuickSel', 'QuickDefaultSel') -call s:hilink('QuickKey', 'QuickDefaultKey') -call s:hilink('QuickOff', 'QuickDefaultDisable') -call s:hilink('QuickHelp', 'QuickDefaultHelp') -call s:hilink('QuickBorder', 'QuickDefaultBorder') -call s:hilink('QuickTermBorder', 'QuickDefaultTermBorder') -call s:hilink('QuickPreview', 'QuickDefaultPreview') - - +call s:set_quickui_hi() From 8403286f996eadcbbca124cc671c3d447111c96b Mon Sep 17 00:00:00 2001 From: roachsinai Date: Wed, 14 Oct 2020 22:02:37 +0800 Subject: [PATCH 2/2] Delete useless function: s:hilink. --- plugin/quickui.vim | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/plugin/quickui.vim b/plugin/quickui.vim index 5ed6b35..3e4b6b6 100644 --- a/plugin/quickui.vim +++ b/plugin/quickui.vim @@ -29,16 +29,6 @@ let s:rtp = fnamemodify(s:home, ':h') "---------------------------------------------------------------------- let g:quickui#style#border = get(g:, 'quickui_border_style', 1) - -"---------------------------------------------------------------------- -" default highlighting -"---------------------------------------------------------------------- -function! s:hilink(name, target) - if !hlexists(a:name) - exec 'hi! link ' . a:name . ' ' . a:target - endif -endfunc - function! s:set_quickui_hi() " hi! QuickDefaultSel ctermbg= hi! link QuickBG QuickDefaultBackground