From b6a4dcce2119090ec8f470c000d3b60b94b79f7d Mon Sep 17 00:00:00 2001 From: manga_osyo Date: Fri, 17 Apr 2015 10:59:12 +0900 Subject: [PATCH] Improve clear highlight. --- autoload/brightest.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/brightest.vim b/autoload/brightest.vim index 8cce8c3..de257e0 100644 --- a/autoload/brightest.vim +++ b/autoload/brightest.vim @@ -72,6 +72,10 @@ endfunction let s:old_enable_window_all = g:brightest#enable_highlight_all_window 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 \ || s:old_enable_window_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) endfunction + function! brightest#on_CursorHold() if s:is_enable() && s:is_enable_on_cursorhold() call brightest#highlighting()