mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.2.1947: crash when using "zj" without folds
Problem: Crash when using "zj" without folds. (Sean Dewar) Solution: Check for at least one fold. (closes #7245)
This commit is contained in:
@@ -902,6 +902,8 @@ foldMoveTo(
|
|||||||
// that moves the cursor is used.
|
// that moves the cursor is used.
|
||||||
lnum_off = 0;
|
lnum_off = 0;
|
||||||
gap = &curwin->w_folds;
|
gap = &curwin->w_folds;
|
||||||
|
if (gap->ga_len == 0)
|
||||||
|
break;
|
||||||
use_level = FALSE;
|
use_level = FALSE;
|
||||||
maybe_small = FALSE;
|
maybe_small = FALSE;
|
||||||
lnum_found = curwin->w_cursor.lnum;
|
lnum_found = curwin->w_cursor.lnum;
|
||||||
|
@@ -835,4 +835,13 @@ func Test_undo_fold_deletion()
|
|||||||
bwipe!
|
bwipe!
|
||||||
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
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1947,
|
||||||
/**/
|
/**/
|
||||||
1946,
|
1946,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user