mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.1972: crash when recreating nested fold
Problem: Crash when recreating nested fold. Solution: Check for empty growarray. (closes #7278)
This commit is contained in:
@@ -640,7 +640,10 @@ foldCreate(linenr_T start, linenr_T end)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = (int)(fp - (fold_T *)gap->ga_data);
|
if (gap->ga_len == 0)
|
||||||
|
i = 0;
|
||||||
|
else
|
||||||
|
i = (int)(fp - (fold_T *)gap->ga_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ga_grow(gap, 1) == OK)
|
if (ga_grow(gap, 1) == OK)
|
||||||
|
@@ -844,4 +844,14 @@ func Test_move_no_folds()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" this was crashing
|
||||||
|
func Test_fold_create_delete_create()
|
||||||
|
new
|
||||||
|
fold
|
||||||
|
fold
|
||||||
|
normal zd
|
||||||
|
fold
|
||||||
|
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 */
|
||||||
|
/**/
|
||||||
|
1972,
|
||||||
/**/
|
/**/
|
||||||
1971,
|
1971,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user