diff src/ex_cmds.c @ 11121:778c10516955 v8.0.0448

patch 8.0.0448: some macros are in lower case commit https://github.com/vim/vim/commit/b5aedf3e228d35821591da9ae8501b61cf2e264c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 12 18:23:53 2017 +0100 patch 8.0.0448: some macros are in lower case Problem: Some macros are in lower case, which can be confusing. Solution: Make a few lower case macros upper case.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Mar 2017 18:30:06 +0100
parents ab9f7bbe4439
children 9bfc9d7b07a7
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -851,24 +851,41 @@ do_move(linenr_T line1, linenr_T line2, 
      * their final destination at the new text position -- webb
      */
     last_line = curbuf->b_ml.ml_line_count;
-    mark_adjust(line1, line2, last_line - line2, 0L);
-    changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines);
+    mark_adjust_nofold(line1, line2, last_line - line2, 0L);
     if (dest >= line2)
     {
-	mark_adjust(line2 + 1, dest, -num_lines, 0L);
+	mark_adjust_nofold(line2 + 1, dest, -num_lines, 0L);
+#ifdef FEAT_FOLDING
+	win_T	    *win;
+	tabpage_T   *tp;
+
+	FOR_ALL_TAB_WINDOWS(tp, win) {
+	    if (win->w_buffer == curbuf)
+		foldSwapRange(&win->w_folds, line1, line2, dest + 1,
+			dest + num_lines);
+	}
+#endif
 	curbuf->b_op_start.lnum = dest - num_lines + 1;
 	curbuf->b_op_end.lnum = dest;
     }
     else
     {
-	mark_adjust(dest + 1, line1 - 1, num_lines, 0L);
+	mark_adjust_nofold(dest + 1, line1 - 1, num_lines, 0L);
+#ifdef FEAT_FOLDING
+	win_T	    *win;
+	tabpage_T   *tp;
+
+	FOR_ALL_TAB_WINDOWS(tp, win) {
+	    if (win->w_buffer == curbuf)
+		foldSwapRange(&win->w_folds, dest + 1, line1 - 1, line1, line2);
+	}
+#endif
 	curbuf->b_op_start.lnum = dest + 1;
 	curbuf->b_op_end.lnum = dest + num_lines;
     }
     curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
-    mark_adjust(last_line - num_lines + 1, last_line,
+    mark_adjust_nofold(last_line - num_lines + 1, last_line,
 					     -(last_line - dest - extra), 0L);
-    changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra);
 
     /*
      * Now we delete the original text -- webb
@@ -4211,7 +4228,7 @@ do_ecmd(
 
 	/* If autocommands change the cursor position or topline, we should
 	 * keep it.  Also when it moves within a line. */
-	if (!equalpos(curwin->w_cursor, orig_pos))
+	if (!EQUAL_POS(curwin->w_cursor, orig_pos))
 	{
 	    newlnum = curwin->w_cursor.lnum;
 	    newcol = curwin->w_cursor.col;