0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14: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:
Bram Moolenaar
2020-12-21 14:01:41 +01:00
parent 9aff970204
commit 6a78f32844
3 changed files with 10 additions and 1 deletions

View File

@@ -916,7 +916,7 @@ foldMoveTo(
{
if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp))
{
if (!updown)
if (!updown || gap->ga_len == 0)
break;
// When moving up, consider a fold above the cursor; when

View File

@@ -852,4 +852,11 @@ func Test_fold_create_delete_create()
bwipe!
endfunc
" this was crashing
func Test_fold_create_delete()
new
norm zFzFzdzj
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2176,
/**/
2175,
/**/