diff options
-rw-r--r-- | plugin/insert_suspend_hlsearch.vim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/insert_suspend_hlsearch.vim b/plugin/insert_suspend_hlsearch.vim index b916ac4..c177f04 100644 --- a/plugin/insert_suspend_hlsearch.vim +++ b/plugin/insert_suspend_hlsearch.vim @@ -18,20 +18,19 @@ let g:loaded_insert_suspend_hlsearch = 1 " disable it if enabled. Note that :nohlsearch does not work for this; see " :help autocmd-searchpat. function s:HlsearchSuspend() - let s:hlsearch = &hlsearch - if s:hlsearch + let s:hlsearch_save = &hlsearch + if s:hlsearch_save set nohlsearch endif - return endfunction " Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was " called. function s:HlsearchRestore() - if s:hlsearch + if s:hlsearch_save set hlsearch endif - return + unlet s:hlsearch_save endfunction " Clear search highlighting as soon as I enter insert mode, and restore it |