diff options
author | Brandon Simmons <simmsbra@gmail.com> | 2022-05-10 19:13:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-10 19:13:23 +0100 |
commit | d98e75e23666c159c7e00bcf5b6ad9a933bb0534 (patch) | |
tree | c051aac5941530e07ef03fceb8cc6905500584ab /src/fold.c | |
parent | 70c41241c2701f26a99085e433925a206ca265a3 (diff) |
patch 8.2.4935: with 'foldmethod' "indent" some lines not included in foldv8.2.4935
Problem: With 'foldmethod' "indent" some lines are not included in the
fold. (Oleg Koshovetc)
Solution: Fix it. (Brandon Simmons, closes #10399, closes #3214)
Diffstat (limited to 'src/fold.c')
-rw-r--r-- | src/fold.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fold.c b/src/fold.c index f94b38949b..7c51557073 100644 --- a/src/fold.c +++ b/src/fold.c @@ -2246,7 +2246,14 @@ foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot) 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. |