diff options
Diffstat (limited to 'plugin/cursorline_current.vim')
-rw-r--r-- | plugin/cursorline_current.vim | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugin/cursorline_current.vim b/plugin/cursorline_current.vim index 43bf882..b0c38b4 100644 --- a/plugin/cursorline_current.vim +++ b/plugin/cursorline_current.vim @@ -1,18 +1,18 @@ " " cursorline_current: If 'cursorline' is globally on, only enable it for the -" current window, and only when not in insert mode. Essentially, make +" current window, and only when not in insert mode. Essentially, make " 'cursorline' follow the actual normal-mode cursor as much as possible. " " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself " -if exists('g:loaded_cursorline_current') || &compatible +if exists('loaded_cursorline_current') || &compatible finish endif if !has('autocmd') || !has('windows') || v:version < 700 finish endif -let g:loaded_cursorline_current = 1 +let loaded_cursorline_current = 1 " Suspend 'cursorline' when a window is inactive or inserting function! s:Suspend() abort @@ -30,19 +30,19 @@ endfunction function! s:Load() abort " Cache current window index - let l:wcur = winnr() + let wcur = winnr() " Iterate through all the windows and suspend all but the current one - for l:wnum in range(1, winnr('$')) - if l:wnum == l:wcur + for wnum in range(1, winnr('$')) + if wnum == wcur continue endif - execute l:wnum . 'wincmd w' + execute wnum . 'wincmd w' call s:Suspend() endfor " Return to the window in which we started - execute l:wcur . 'wincmd w' + execute wcur . 'wincmd w' endfunction @@ -53,7 +53,7 @@ augroup cursorline_current " Turn off 'cursorline' for other windows on load autocmd VimEnter * call s:Load() - " Turn off 'cursorline' when leaving a window or losing focus. We call the + " Turn off 'cursorline' when leaving a window or losing focus. We call the " restore again on BufEnter to handle existent local buffer values for the " option overwriting the window value (Vim bug?) autocmd WinLeave,FocusLost * call s:Suspend() |