aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-28 21:44:25 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-28 21:44:25 +1200
commite38d3c95af32ba73c6dc8ded57d31a784987e9e9 (patch)
tree64e37bd0f5d6372b96e40e58b62c1700de8d6135
parentMerge branch 'release/v0.2.0' (diff)
parentBump VERSION (diff)
downloadvim-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--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>