mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.2.2176: crash with a sequence of fold commands
Problem: Crash with a sequence of fold commands. Solution: Bail out when there are no folds at all. Add a test (Dominique Pellé) (closes #7515)
This commit is contained in:
@@ -916,7 +916,7 @@ foldMoveTo(
|
|||||||
{
|
{
|
||||||
if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp))
|
if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp))
|
||||||
{
|
{
|
||||||
if (!updown)
|
if (!updown || gap->ga_len == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// When moving up, consider a fold above the cursor; when
|
// When moving up, consider a fold above the cursor; when
|
||||||
|
@@ -852,4 +852,11 @@ func Test_fold_create_delete_create()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" this was crashing
|
||||||
|
func Test_fold_create_delete()
|
||||||
|
new
|
||||||
|
norm zFzFzdzj
|
||||||
|
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 */
|
||||||
|
/**/
|
||||||
|
2176,
|
||||||
/**/
|
/**/
|
||||||
2175,
|
2175,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user