diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:48:27 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:48:27 +1200 |
commit | 2d5dd9304a2c372e5519c67d2d600e874fceee1e (patch) | |
tree | d29a1ecda3d665fce94d6cebd959e11106d9a62d /autoload | |
parent | Merge branch 'release/v0.7.0' into develop (diff) | |
download | vim-insert-suspend-hlsearch-2d5dd9304a2c372e5519c67d2d600e874fceee1e.tar.gz vim-insert-suspend-hlsearch-2d5dd9304a2c372e5519c67d2d600e874fceee1e.zip |
Overhaul with autoloading for new version
Diffstat (limited to 'autoload')
-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 |