summaryrefslogtreecommitdiffstats
path: root/src/fold.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-03 20:05:40 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-03 20:05:40 +0100
commitc136a3528b7ebb825c3863d701af44f023381181 (patch)
tree3578f565a084562a2c5c803a4820e33cdadbfbbc /src/fold.c
parent35efa22ff2b98126363098db9304796b5624f97f (diff)
patch 8.2.1947: crash when using "zj" without foldsv8.2.1947
Problem: Crash when using "zj" without folds. (Sean Dewar) Solution: Check for at least one fold. (closes #7245)
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fold.c b/src/fold.c
index 8a904f64c6..4b4e618299 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -902,6 +902,8 @@ foldMoveTo(
// that moves the cursor is used.
lnum_off = 0;
gap = &curwin->w_folds;
+ if (gap->ga_len == 0)
+ break;
use_level = FALSE;
maybe_small = FALSE;
lnum_found = curwin->w_cursor.lnum;