aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-01 10:31:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-01 10:31:57 +1200
commite71b7605705cc2caed9ae74b8578c71c304b2777 (patch)
tree803b5e67894e17d1bfc2824d98c75d7a23371fe4
parentInitial commit (diff)
parentClear cache variable once no longer needed (diff)
downloadvim-insert-suspend-hlsearch-e71b7605705cc2caed9ae74b8578c71c304b2777.tar.gz
vim-insert-suspend-hlsearch-e71b7605705cc2caed9ae74b8578c71c304b2777.zip
Merge branch 'release/v0.2.0'v0.2.0
* release/v0.2.0: Clear cache variable once no longer needed Rename cache variable for clarity Remove unneeded function returns
-rw-r--r--plugin/insert_suspend_hlsearch.vim9
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