From 33edf8d9dd6aa0ccfa63a2caa91c088a722bf2a4 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 20 Sep 2013 15:28:21 +0200 Subject: [PATCH] Fix cursor handling #2 --- autoload/startify.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index f0ed554..6a3c636 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -47,7 +47,7 @@ function! startify#insane_in_the_membrane() abort endif setlocal noswapfile nobuflisted buftype=nofile bufhidden=wipe - setlocal nonumber nolist statusline=\ startify + setlocal nonumber nocursorline nolist statusline=\ startify setfiletype startify if v:version >= 703 @@ -366,7 +366,8 @@ function! s:set_cursor() abort " going down if s:newline > s:oldline - if empty(getline(s:newline)) | let s:newline += 1 | endif + if empty(getline(s:newline)) | let s:newline += 1 | endif + if s:newline > s:lastline | let s:newline = s:lastline | endif " going up elseif s:newline < s:oldline if empty(getline(s:newline)) | let s:newline -= 1 | endif