From 33f141c3c044b175d53cf161f31b90aebb0bda84 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Fri, 12 Feb 2016 06:39:40 +0900 Subject: [PATCH] Cursor highlight doesn't exist for some environment fix #275 --- autoload/vital/_easymotion/HitAHint/Motion.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/vital/_easymotion/HitAHint/Motion.vim b/autoload/vital/_easymotion/HitAHint/Motion.vim index 3bf68a3..1975bc4 100644 --- a/autoload/vital/_easymotion/HitAHint/Motion.vim +++ b/autoload/vital/_easymotion/HitAHint/Motion.vim @@ -69,6 +69,7 @@ let s:overwin = { \ 'highlight': { \ 'shade': 'HitAHintShade', \ 'target': 'HitAHintTarget', +\ 'cursor': 'HitAHintCursor', \ }, \ 'jump_first_target_keys': [], \ 'do_shade': s:TRUE, @@ -78,6 +79,16 @@ let s:overwin = { function! s:_init_hl() abort highlight default HitAHintShade ctermfg=242 guifg=#777777 highlight default HitAHintTarget ctermfg=81 guifg=#66D9EF + " Cursor highlight doesn't exist for some environment with some + " colorscheme ref:#275 + " e.g. + " - :colorscheme default + " - :colorscheme hybrid + if hlexists('Cursor') + highlight default link HitAHintCursor Cursor + else + highlight default HitAHintCursor term=reverse cterm=reverse gui=reverse + endif endfunction call s:_init_hl() @@ -287,7 +298,7 @@ function! s:Hinter.init(hint_dict) abort endfunction function! s:Hinter.before() abort - let self.highlight_id_cursor = matchadd('Cursor', '\%#', 101) + let self.highlight_id_cursor = matchadd(self.config.highlight.cursor, '\%#', 101) call self.save_options() call self.disable_conceal_in_other_win() endfunction