diff src/register.c @ 31762:b53ab3c3e0c9 v9.0.1213

patch 9.0.1213: adding a line below the last one does not expand fold Commit: https://github.com/vim/vim/commit/da3dd7d857ba4fb4bf408dedd1d9d6a2d5e2ae9f Author: Brandon Simmons <simmsbra@gmail.com> Date: Tue Jan 17 19:48:07 2023 +0000 patch 9.0.1213: adding a line below the last one does not expand fold 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 17 Jan 2023 21:00:05 +0100
parents 360f286b5869
children 579c846086eb
line wrap: on
line diff
--- a/src/register.c
+++ b/src/register.c
@@ -2208,15 +2208,7 @@ error:
 		if (dir == FORWARD)
 		    curbuf->b_op_start.lnum++;
 	    }
-	    // Skip mark_adjust when adding lines after the last one, there
-	    // can't be marks there. But still needed in diff mode.
-	    if (curbuf->b_op_start.lnum + (y_type == MCHAR) - 1 + nr_lines
-						 < curbuf->b_ml.ml_line_count
-#ifdef FEAT_DIFF
-						 || curwin->w_p_diff
-#endif
-						 )
-		mark_adjust(curbuf->b_op_start.lnum + (y_type == MCHAR),
+	    mark_adjust(curbuf->b_op_start.lnum + (y_type == MCHAR),
 					     (linenr_T)MAXLNUM, nr_lines, 0L);
 
 	    // note changed text for displaying and folding