diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 18:22:26 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 18:22:26 +1200 |
commit | 0b7cb75d1bd8eac9e411ee344f78608122e69d6f (patch) | |
tree | bd526a10103cf58bc86645e581c06c94470129e6 | |
parent | Update updated date (diff) | |
parent | Bump VERSION (diff) | |
download | vim-insert-suspend-hlsearch-0b7cb75d1bd8eac9e411ee344f78608122e69d6f.tar.gz vim-insert-suspend-hlsearch-0b7cb75d1bd8eac9e411ee344f78608122e69d6f.zip |
Merge branch 'release/v0.5.0'v0.5.0
* release/v0.5.0:
Bump VERSION
Simplify cache variable
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | autoload/insert_suspend_hlsearch.vim | 11 |
2 files changed, 5 insertions, 8 deletions
@@ -1 +1 @@ -0.4.0 +0.5.0 diff --git a/autoload/insert_suspend_hlsearch.vim b/autoload/insert_suspend_hlsearch.vim index 3000ac1..2638abc 100644 --- a/autoload/insert_suspend_hlsearch.vim +++ b/autoload/insert_suspend_hlsearch.vim @@ -1,14 +1,12 @@ " Initialise option saving variable -if !exists('g:insert_suspend_hlsearch#save') - let g:insert_suspend_hlsearch#save = 0 -endif +let s:hlsearch = &hlsearch " Save the current value of the 'hlsearch' option in a script variable, and " disable it if enabled. Note that :nohlsearch does not work for this; see " :help autocmd-searchpat. function! insert_suspend_hlsearch#Suspend() abort - let g:insert_suspend_hlsearch#save = &hlsearch - if g:insert_suspend_hlsearch#save + let s:hlsearch = &hlsearch + if s:hlsearch set nohlsearch endif endfunction @@ -16,8 +14,7 @@ endfunction " Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was " called. function! insert_suspend_hlsearch#Restore() abort - if g:insert_suspend_hlsearch#save + if s:hlsearch set hlsearch - unlet g:insert_suspend_hlsearch#save endif endfunction |