Anonymous avatar Anonymous committed 80c529a

updated for version 7.3.395
Problem: "dv?bar" in the last line deletes too much and breaks undo.
Solution: Only adjust the cursor position when it's after the last line of
the buffer. Add a test. (Christian Brabandt)

Comments (0)

Files changed (4)

 		/* Special case: gH<Del> deletes the last line. */
 		del_lines(1L, FALSE);
 		curwin->w_cursor = curpos;	/* restore curwin->w_cursor */
-		if (curwin->w_cursor.lnum > 1)
-		    --curwin->w_cursor.lnum;
+		if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+		    curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
- * implementation of the format operator 'gq'
+ * Implementation of the format operator 'gq'.
 op_format(oap, keep_cursor)


 x:set magic
-x:?^1?,$w! test.out
+:set undolevels=100
+:?^1?,$w! test.out
 6 x ^aa$ x
 7 (a)(b) abbaa
 8 axx [ab]xx
+9 foobar


 6 x aa$ x
 7 (a)(b) abba
 8 axx ab]xx
+9 foobar
+9 foo
 static int included_patches[] =
 {   /* Add new patch number below this line */
+    395,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.