diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:49:16 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:49:16 +1200 |
commit | 0378547786e68b7825fa4893efd7cd240202f121 (patch) | |
tree | 6b4ae466361f32d3f82cbea2f997179c2aa94946 /autoload/insert_suspend_hlsearch.vim | |
parent | Merge branch 'release/v0.7.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-insert-suspend-hlsearch-0378547786e68b7825fa4893efd7cd240202f121.tar.gz vim-insert-suspend-hlsearch-0378547786e68b7825fa4893efd7cd240202f121.zip |
Merge branch 'release/v1.0.0'v1.0.0
* release/v1.0.0:
Overhaul with autoloading for new version
Diffstat (limited to 'autoload/insert_suspend_hlsearch.vim')
-rw-r--r-- | autoload/insert_suspend_hlsearch.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/autoload/insert_suspend_hlsearch.vim b/autoload/insert_suspend_hlsearch.vim new file mode 100644 index 0000000..4961ed9 --- /dev/null +++ b/autoload/insert_suspend_hlsearch.vim @@ -0,0 +1,14 @@ +" Save value of 'hlsearch' into a variable, and disable it +function! insert_suspend_hlsearch#Suspend() abort + let s:hlsearch = &hlsearch + let &hlsearch = 0 +endfunction + +" Restore the value of 'hlsearch' if suspended +function! insert_suspend_hlsearch#Restore() abort + if !exists('s:hlsearch') + return + endif + let &hlsearch = s:hlsearch + unlet s:hlsearch +endfunction |