patch 8.2.4935: with 'foldmethod' "indent" some lines not included in fold
Problem: With 'foldmethod' "indent" some lines are not included in the
fold. (Oleg Koshovetc)
Solution: Fix it. (Brandon Simmons, closes #10399, closes #3214)
diff --git a/src/fold.c b/src/fold.c
index f94b389..7c51557 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -2246,7 +2246,14 @@
getlevel = foldlevelDiff;
#endif
else
+ {
getlevel = foldlevelIndent;
+ // Start one line back, because if the line above "top" has an
+ // undefined fold level, folding it relies on the line under it,
+ // which is "top".
+ if (top > 1)
+ --fline.lnum;
+ }
// Backup to a line for which the fold level is defined. Since it's
// always defined for line one, we will stop there.