From 7421c03392b8dd5075ef205582a56c7eb6f382c2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 12 Jul 2018 12:44:27 +1200 Subject: Remove autoload --- autoload/insert_suspend_hlsearch.vim | 20 -------------------- plugin/insert_suspend_hlsearch.vim | 25 +++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 autoload/insert_suspend_hlsearch.vim diff --git a/autoload/insert_suspend_hlsearch.vim b/autoload/insert_suspend_hlsearch.vim deleted file mode 100644 index 2638abc..0000000 --- a/autoload/insert_suspend_hlsearch.vim +++ /dev/null @@ -1,20 +0,0 @@ -" Initialise option saving variable -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 s:hlsearch = &hlsearch - if s:hlsearch - set nohlsearch - endif -endfunction - -" Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was -" called. -function! insert_suspend_hlsearch#Restore() abort - if s:hlsearch - set hlsearch - endif -endfunction diff --git a/plugin/insert_suspend_hlsearch.vim b/plugin/insert_suspend_hlsearch.vim index 5dd1e74..5d199f7 100644 --- a/plugin/insert_suspend_hlsearch.vim +++ b/plugin/insert_suspend_hlsearch.vim @@ -14,10 +14,31 @@ if !has('autocmd') || !has('extra_search') || v:version < 700 endif let g:loaded_insert_suspend_hlsearch = 1 +" Initialise option saving variable +let s:hlsearch_save = &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! s:Suspend() abort + let s:hlsearch_save = &hlsearch + if &hlsearch + set nohlsearch + endif +endfunction + +" Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was +" called. +function! s:Restore() abort + if !&hlsearch && s:hlsearch_save + set hlsearch + endif +endfunction + " Clear search highlighting as soon as I enter insert mode, and restore it " once left augroup insert_suspend_hlsearch autocmd! - autocmd InsertEnter * call insert_suspend_hlsearch#Suspend() - autocmd InsertLeave * call insert_suspend_hlsearch#Restore() + autocmd InsertEnter * call s:Suspend() + autocmd InsertLeave * call s:Restore() augroup END -- cgit v1.2.3 From 4a72a805020d80846147f4f289c92286896eaa57 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 12 Jul 2018 12:45:30 +1200 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8f0916f..a918a2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0 +0.6.0 -- cgit v1.2.3