summaryrefslogtreecommitdiffstats
path: root/src/change.c
diff options
context:
space:
mode:
authorBrandon Simmons <simmsbra@gmail.com>2023-01-17 19:48:07 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-17 19:48:07 +0000
commitda3dd7d857ba4fb4bf408dedd1d9d6a2d5e2ae9f (patch)
tree4708aeb8921599d5e043349a0c8b9d7000b705dc /src/change.c
parent66bb9ae70f7371456ed76518076d2a344f8ab417 (diff)
patch 9.0.1213: adding a line below the last one does not expand foldv9.0.1213
Problem: Adding a line below the last one does not expand fold. Solution: Do not skip mark_adjust() when adding lines below the last one. (Brandon Simmons, closes #11832, closes #10698)
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/change.c b/src/change.c
index dc68d3cf7c..1e7bdd6bdb 100644
--- a/src/change.c
+++ b/src/change.c
@@ -772,14 +772,7 @@ appended_lines(linenr_T lnum, long count)
void
appended_lines_mark(linenr_T lnum, long count)
{
- // Skip mark_adjust when adding a line after the last one, there can't
- // be marks there. But it's still needed in diff mode.
- if (lnum + count < curbuf->b_ml.ml_line_count
-#ifdef FEAT_DIFF
- || curwin->w_p_diff
-#endif
- )
- mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L);
+ mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L);
changed_lines(lnum + 1, 0, lnum + 1, count);
}
@@ -2142,14 +2135,7 @@ open_line(
goto theend;
// Postpone calling changed_lines(), because it would mess up folding
// with markers.
- // Skip mark_adjust when adding a line after the last one, there can't
- // be marks there. But still needed in diff mode.
- if (curwin->w_cursor.lnum + 1 < curbuf->b_ml.ml_line_count
-#ifdef FEAT_DIFF
- || curwin->w_p_diff
-#endif
- )
- mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
+ mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
did_append = TRUE;
#ifdef FEAT_PROP_POPUP
if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0)