diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:05:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:05:15 +0000 |
commit | 6e9cd6b491267e6dff3e3f3f37d8af5f28e40672 (patch) | |
tree | 35661af16c4a0ef2a9a8e225d2d5cc82605ea289 /src/fold.c | |
parent | Adding upstream version 2:9.1.0496. (diff) | |
download | vim-6e9cd6b491267e6dff3e3f3f37d8af5f28e40672.tar.xz vim-6e9cd6b491267e6dff3e3f3f37d8af5f28e40672.zip |
Adding upstream version 2:9.1.0698.upstream/2%9.1.0698
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fold.c')
-rw-r--r-- | src/fold.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1492,6 +1492,9 @@ deleteFoldRecurse(garray_T *gap) // foldMarkAdjust() {{{2 /* * Update line numbers of folds for inserted/deleted lines. + * + * We are adjusting the folds in the range from line1 til line2, + * make sure that line2 does not get smaller than line1 */ void foldMarkAdjust( @@ -1505,6 +1508,8 @@ foldMarkAdjust( // lines, set line2 so that only deleted lines have their folds removed. if (amount == MAXLNUM && line2 >= line1 && line2 - line1 >= -amount_after) line2 = line1 - amount_after - 1; + if (line2 < line1) + line2 = line1; // If appending a line in Insert mode, it should be included in the fold // just above the line. if ((State & MODE_INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM) |