Improve clear highlight.

This commit is contained in:
manga_osyo
2015-04-17 10:59:12 +09:00
parent 952593481c
commit b6a4dcce21

View File

@@ -72,6 +72,10 @@ endfunction
let s:old_enable_window_all = g:brightest#enable_highlight_all_window let s:old_enable_window_all = g:brightest#enable_highlight_all_window
function! brightest#hl_clear() function! brightest#hl_clear()
if empty(s:Highlight.hl_list())
return
endif
" call s:Highlight.as_windo().disable_all()
if g:brightest#enable_highlight_all_window if g:brightest#enable_highlight_all_window
\ || s:old_enable_window_all \ || s:old_enable_window_all
call s:Highlight.as_windo().disable_all() call s:Highlight.as_windo().disable_all()
@@ -262,6 +266,7 @@ function! s:is_enable_on_cursorhold()
return g:brightest#enable_on_CursorHold && get(b:, "brightest_enable_on_CursorHold", 1) return g:brightest#enable_on_CursorHold && get(b:, "brightest_enable_on_CursorHold", 1)
endfunction endfunction
function! brightest#on_CursorHold() function! brightest#on_CursorHold()
if s:is_enable() && s:is_enable_on_cursorhold() if s:is_enable() && s:is_enable_on_cursorhold()
call brightest#highlighting() call brightest#highlighting()