From 2e1bb38fc7c3ea68f88bd2495b584b043a501ccc Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 11:46:40 +1200 Subject: Switch to two-spacing --- README.md | 4 ++-- doc/cursorline_current.txt | 6 +++--- plugin/cursorline_current.vim | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 839a5ee..24c2b35 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ cursorline\_current.vim ======================= This plugin tweaks the behaviour of the `'cursorline'` option to enable it only -in the current window and when not in insert mode. It essentially makes +in the current window and when not in insert mode. It essentially makes `'cursorline'` follow the cursor in normal mode as much as possible. License ------- -Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. See `:help license`. [1]: https://sanctum.geek.nz/ diff --git a/doc/cursorline_current.txt b/doc/cursorline_current.txt index 1a84ece..a6a4514 100644 --- a/doc/cursorline_current.txt +++ b/doc/cursorline_current.txt @@ -4,7 +4,7 @@ DESCRIPTION *cursorline_current* This plugin tweaks the behaviour of the 'cursorline' option to enable it only in the current window, when not in insert mode, and (if supported) when Vim -has focus. It essentially makes 'cursorline' follow the cursor in normal mode +has focus. It essentially makes 'cursorline' follow the cursor in normal mode as much as possible. It uses the global value of 'cursorline' as its default, and should also @@ -12,14 +12,14 @@ correctly handle local values for windows. REQUIREMENTS *cursorline_current-requirements* -This plugin only loads if 'compatible' is not set. It requires the |+autocmd| +This plugin only loads if 'compatible' is not set. It requires the |+autocmd| and |+windows| features. OPTIONS *cursorline_current-options* *g:cursorline_current_insert* Set `g:cursorline_current_insert` to 0 in your |vimrc| if you don't like the -cursor line switching off while you're in insert mode. This option defaults to +cursor line switching off while you're in insert mode. This option defaults to 1. AUTHOR *cursorline_current-author* diff --git a/plugin/cursorline_current.vim b/plugin/cursorline_current.vim index 43bf882..9977f95 100644 --- a/plugin/cursorline_current.vim +++ b/plugin/cursorline_current.vim @@ -1,6 +1,6 @@ " " 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 @@ -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() -- cgit v1.2.3 From 40213bb20280045558068bb8287cb672717b2214 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 11:46:45 +1200 Subject: Remove unneeded variable scoping --- plugin/cursorline_current.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin/cursorline_current.vim b/plugin/cursorline_current.vim index 9977f95..b0c38b4 100644 --- a/plugin/cursorline_current.vim +++ b/plugin/cursorline_current.vim @@ -6,13 +6,13 @@ " Author: Tom Ryder " 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 -- cgit v1.2.3 From 043363cee344eb087e12407f32c93f5e1b20ef5c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 11:47:30 +1200 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0d91a54..1d0ba9e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0 -- cgit v1.2.3