mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 09:19:43 +10:00
vim-patch:9.1.0617: Cursor moves beyond first line of folded end of buffer (#29859)
Problem: Cursor moves beyond start of a folded range at the end of a buffer.
Solution: Move cursor to start of fold when going beyond end of buffer.
Check that cursor moved to detect FAIL in outer cursor function.
(Luuk van Baal)
dc373d456b
This commit is contained in:
@@ -1659,4 +1659,18 @@ func Test_foldexpr_end_fold()
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test moving cursor down to or beyond start of folded end of buffer.
|
||||
func Test_cursor_down_fold_eob()
|
||||
call setline(1, range(1, 4))
|
||||
norm Gzf2kj
|
||||
call assert_equal(2, line('.'))
|
||||
norm zojzc
|
||||
call assert_equal(3, line('.'))
|
||||
norm j
|
||||
call assert_equal(3, line('.'))
|
||||
norm k2j
|
||||
call assert_equal(4, line('.'))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user