aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--autoload/scroll_next.vim9
-rw-r--r--doc/scroll_next.txt6
-rw-r--r--plugin/scroll_next.vim18
4 files changed, 14 insertions, 21 deletions
diff --git a/VERSION b/VERSION
index 0ea3a94..0d91a54 100644
--- a/VERSION
+++ b/VERSION
@@ -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>