Make cursor not wrap around
The wrap around feature was nice, but added too much code for what it was worth. It also kind of defeated navigation by motions like }, gg etc.
This commit is contained in:
parent
eb6e522245
commit
7a4b8bc340
|
@ -82,9 +82,6 @@ function! startify#insane_in_the_membrane() abort
|
||||||
call append('$', ['', ' [q] <quit>'])
|
call append('$', ['', ' [q] <quit>'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:lastline = line('$')
|
|
||||||
call append('$', '')
|
|
||||||
|
|
||||||
if exists('g:startify_custom_footer')
|
if exists('g:startify_custom_footer')
|
||||||
call append('$', g:startify_custom_footer)
|
call append('$', g:startify_custom_footer)
|
||||||
endif
|
endif
|
||||||
|
@ -367,30 +364,14 @@ function! s:set_cursor() abort
|
||||||
|
|
||||||
" going down
|
" going down
|
||||||
if s:newline > s:oldline
|
if s:newline > s:oldline
|
||||||
if empty(getline(s:newline))
|
if empty(getline(s:newline)) | let s:newline += 1 | endif
|
||||||
let s:newline += 1
|
|
||||||
endif
|
|
||||||
if s:newline > s:lastline
|
|
||||||
call cursor(headoff, 5)
|
|
||||||
let s:newline = headoff
|
|
||||||
else
|
|
||||||
call cursor(s:newline, 5)
|
|
||||||
endif
|
|
||||||
" going up
|
" going up
|
||||||
elseif s:newline < s:oldline
|
elseif s:newline < s:oldline
|
||||||
if empty(getline(s:newline))
|
if empty(getline(s:newline)) | let s:newline -= 1 | endif
|
||||||
let s:newline -= 1
|
if s:newline < headoff | let s:newline = headoff | endif
|
||||||
endif
|
|
||||||
if s:newline < headoff
|
|
||||||
call cursor(s:lastline, 5)
|
|
||||||
let s:newline = s:lastline
|
|
||||||
else
|
|
||||||
call cursor(s:newline, 5)
|
|
||||||
endif
|
|
||||||
" hold cursor in column
|
|
||||||
else
|
|
||||||
call cursor(s:newline, 5)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call cursor(s:newline, 5)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:set_mark {{{1
|
" Function: s:set_mark {{{1
|
||||||
|
|
Loading…
Reference in a new issue