Mercurial > vim
comparison src/fold.c @ 28823:980eaa09f940 v8.2.4935
patch 8.2.4935: with 'foldmethod' "indent" some lines not included in fold
Commit: https://github.com/vim/vim/commit/d98e75e23666c159c7e00bcf5b6ad9a933bb0534
Author: Brandon Simmons <simmsbra@gmail.com>
Date: Tue May 10 19:13:23 2022 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 10 May 2022 20:15:02 +0200 |
parents | d770568e6c98 |
children | 2ac9beab876c |
comparison
equal
deleted
inserted
replaced
28822:a89ae180fa50 | 28823:980eaa09f940 |
---|---|
2244 #ifdef FEAT_DIFF | 2244 #ifdef FEAT_DIFF |
2245 else if (foldmethodIsDiff(wp)) | 2245 else if (foldmethodIsDiff(wp)) |
2246 getlevel = foldlevelDiff; | 2246 getlevel = foldlevelDiff; |
2247 #endif | 2247 #endif |
2248 else | 2248 else |
2249 { | |
2249 getlevel = foldlevelIndent; | 2250 getlevel = foldlevelIndent; |
2251 // Start one line back, because if the line above "top" has an | |
2252 // undefined fold level, folding it relies on the line under it, | |
2253 // which is "top". | |
2254 if (top > 1) | |
2255 --fline.lnum; | |
2256 } | |
2250 | 2257 |
2251 // Backup to a line for which the fold level is defined. Since it's | 2258 // Backup to a line for which the fold level is defined. Since it's |
2252 // always defined for line one, we will stop there. | 2259 // always defined for line one, we will stop there. |
2253 fline.lvl = -1; | 2260 fline.lvl = -1; |
2254 for ( ; !got_int; --fline.lnum) | 2261 for ( ; !got_int; --fline.lnum) |