From 952e8379d2769449a84c0a55bf6996d74f3b822e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 1 Jun 2018 10:27:38 +1200 Subject: Remove unneeded function returns --- plugin/insert_suspend_hlsearch.vim | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugin/insert_suspend_hlsearch.vim b/plugin/insert_suspend_hlsearch.vim index b916ac4..cf096d5 100644 --- a/plugin/insert_suspend_hlsearch.vim +++ b/plugin/insert_suspend_hlsearch.vim @@ -22,7 +22,6 @@ function s:HlsearchSuspend() if s:hlsearch set nohlsearch endif - return endfunction " Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was @@ -31,7 +30,6 @@ function s:HlsearchRestore() if s:hlsearch set hlsearch endif - return endfunction " Clear search highlighting as soon as I enter insert mode, and restore it -- cgit v1.2.3 From 8e9f7cc813282dafbbf1e4ad281122066ced036e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 1 Jun 2018 10:30:00 +1200 Subject: Rename cache variable for clarity --- plugin/insert_suspend_hlsearch.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/insert_suspend_hlsearch.vim b/plugin/insert_suspend_hlsearch.vim index cf096d5..a5d8fd1 100644 --- a/plugin/insert_suspend_hlsearch.vim +++ b/plugin/insert_suspend_hlsearch.vim @@ -18,8 +18,8 @@ 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 endfunction @@ -27,7 +27,7 @@ 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 endfunction -- cgit v1.2.3 From bc6b138b481b2fe44ad270073bec6571084301ab Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 1 Jun 2018 10:30:08 +1200 Subject: Clear cache variable once no longer needed --- plugin/insert_suspend_hlsearch.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/insert_suspend_hlsearch.vim b/plugin/insert_suspend_hlsearch.vim index a5d8fd1..c177f04 100644 --- a/plugin/insert_suspend_hlsearch.vim +++ b/plugin/insert_suspend_hlsearch.vim @@ -30,6 +30,7 @@ function s:HlsearchRestore() if s:hlsearch_save set hlsearch endif + unlet s:hlsearch_save endfunction " Clear search highlighting as soon as I enter insert mode, and restore it -- cgit v1.2.3