mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
vim-patch:8.2.1947: crash when using "zj" without folds (#13222)
Problem: Crash when using "zj" without folds. (Sean Dewar)
Solution: Check for at least one fold. (closes vim/vim#7245)
c136a3528b
This commit is contained in:
@@ -888,6 +888,9 @@ int foldMoveTo(
|
|||||||
// that moves the cursor is used.
|
// that moves the cursor is used.
|
||||||
linenr_T lnum_off = 0;
|
linenr_T lnum_off = 0;
|
||||||
garray_T *gap = &curwin->w_folds;
|
garray_T *gap = &curwin->w_folds;
|
||||||
|
if (gap->ga_len == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
bool use_level = false;
|
bool use_level = false;
|
||||||
bool maybe_small = false;
|
bool maybe_small = false;
|
||||||
linenr_T lnum_found = curwin->w_cursor.lnum;
|
linenr_T lnum_found = curwin->w_cursor.lnum;
|
||||||
|
@@ -795,3 +795,14 @@ func Test_fold_delete_first_line()
|
|||||||
bwipe!
|
bwipe!
|
||||||
set foldmethod&
|
set foldmethod&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" this was crashing
|
||||||
|
func Test_move_no_folds()
|
||||||
|
new
|
||||||
|
fold
|
||||||
|
setlocal fdm=expr
|
||||||
|
normal zj
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user