diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-28 21:44:25 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-28 21:44:25 +1200 |
commit | e38d3c95af32ba73c6dc8ded57d31a784987e9e9 (patch) | |
tree | 64e37bd0f5d6372b96e40e58b62c1700de8d6135 | |
parent | Merge branch 'release/v0.2.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-scroll-next-e38d3c95af32ba73c6dc8ded57d31a784987e9e9.tar.gz vim-scroll-next-e38d3c95af32ba73c6dc8ded57d31a784987e9e9.zip |
Merge branch 'release/v0.3.0'v0.3.0
* release/v0.3.0:
Bump VERSION
Drop Vim 6.x support
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | autoload/scroll_next.vim | 9 | ||||
-rw-r--r-- | doc/scroll_next.txt | 6 | ||||
-rw-r--r-- | plugin/scroll_next.vim | 18 |
4 files changed, 14 insertions, 21 deletions
@@ -1 +1 @@ -0.2.0 +0.3.0 diff --git a/autoload/scroll_next.vim b/autoload/scroll_next.vim new file mode 100644 index 0000000..8758208 --- /dev/null +++ b/autoload/scroll_next.vim @@ -0,0 +1,9 @@ +" Check visibility of last line and flick to :next if appropriate, or just +" page forward with PageDown +function! scroll_next#ScrollNext() abort + if line('w$') == line('$') + silent! next + else + execute "normal! \<PageDown>" + endif +endfunction diff --git a/doc/scroll_next.txt b/doc/scroll_next.txt index c53bbfb..af187e8 100644 --- a/doc/scroll_next.txt +++ b/doc/scroll_next.txt @@ -1,4 +1,4 @@ -*scroll_next.txt* For Vim version 6.0 Last change: 2018 Aug 15 +*scroll_next.txt* For Vim version 7.0 Last change: 2019 May 28 DESCRIPTION *scroll_next* @@ -11,9 +11,7 @@ limited keyboards, such as a mobile phone terminal client. REQUIREMENTS *scroll_next-requirements* -This plugin only loads if 'compatible' is not set. It works on |version6| and -newer. If you have |version7| then you don't have to hit the last line of the -buffer; it just has to be visible in the window. +This plugin only loads if 'compatible' is not set. MAPPINGS *scroll_next-mappings* diff --git a/plugin/scroll_next.vim b/plugin/scroll_next.vim index 8f09b24..4535223 100644 --- a/plugin/scroll_next.vim +++ b/plugin/scroll_next.vim @@ -5,26 +5,12 @@ " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself " -if exists('loaded_scroll_next') || &compatible - finish -endif -if v:version < 600 +if exists('loaded_scroll_next') || &compatible || v:version < 700 finish endif let loaded_scroll_next = 1 -" Check visibility of last line (Vim >=7.0) or cursor presence on last line -" and flick to :next if appropriate, or just page forward with PageDown -function! s:ScrollNext() abort - if line('.') == line('$') - \ || line('w$') == line('$') - silent! next - else - execute "normal! \<PageDown>" - endif -endfunction - " Mapping setup nnoremap <silent> <unique> \ <Plug>(ScrollNext) - \ :<C-U>call <SID>ScrollNext()<CR> + \ :<C-U>call scroll_next#ScrollNext()<CR> |