diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-19 17:20:01 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-19 17:20:01 +1300 |
commit | 5f3b58d62ca9e348468f1ce622e86badbd5d6e8f (patch) | |
tree | f2d81aaa586d379f0998a6a02e34ec8a2997bf19 /vim/autoload/colorscheme.vim | |
parent | Merge branch 'release/v8.6.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-5f3b58d62ca9e348468f1ce622e86badbd5d6e8f.tar.gz dotfiles-5f3b58d62ca9e348468f1ce622e86badbd5d6e8f.zip |
Merge branch 'release/v8.7.0'v8.7.0
* release/v8.7.0:
Overhaul spellfile_local.vim plugin
Remove complex 'spellfile' setting
Comment and clean up new Vim configuration
Diffstat (limited to 'vim/autoload/colorscheme.vim')
-rw-r--r-- | vim/autoload/colorscheme.vim | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vim/autoload/colorscheme.vim b/vim/autoload/colorscheme.vim index 591550fd..db965d99 100644 --- a/vim/autoload/colorscheme.vim +++ b/vim/autoload/colorscheme.vim @@ -1,10 +1,21 @@ " Reset window-global value for 'cursorline' based on current colorscheme name function! colorscheme#UpdateCursorline(colors_name, list) abort + + " Record current tab and window number so we can jump back once we're done let l:tab = tabpagenr() let l:win = winnr() - tabdo windo let &g:cursorline = index(a:list, a:colors_name) >= 0 + + " Set the window-global value for 'cursorline' in each window of each tab; + " on if the current colorscheme is in the whitelist, and off otherwise; fire + " the WinEnter and WinLeave events so any other 'cursorline' related hooks + " can run too + let l:cursorline = index(a:list, a:colors_name) >= 0 + tabdo windo let &g:cursorline = l:cursorline \| silent doautocmd WinEnter,WinLeave + + " Move back to the tab and window the user started in execute l:tab . 'tabnext' execute l:win . 'wincmd w' \| silent doautocmd WinEnter + endfunction |