diff src/ex_cmds.c @ 9377:5ec4fbfe38c5 v7.4.1970

commit https://github.com/vim/vim/commit/70e136e1d86ea1d795774824c7b712245912946d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 1 14:04:51 2016 +0200 patch 7.4.1970 Problem: Using ":insert" in an empty buffer sets the jump mark. (Ingo Karkat) Solution: Don't adjust marks when replacing the empty line in an empty buffer. (closes #892)
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Jul 2016 14:15:06 +0200
parents 25c562442f8c
children f094d4085014
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4372,7 +4372,7 @@ ex_append(exarg_T *eap)
     if (eap->cmdidx != CMD_append)
 	--lnum;
 
-    /* when the buffer is empty append to line 0 and delete the dummy line */
+    /* when the buffer is empty need to delete the dummy line */
     if (empty && lnum == 1)
 	lnum = 0;
 
@@ -4456,7 +4456,7 @@ ex_append(exarg_T *eap)
 
 	did_undo = TRUE;
 	ml_append(lnum, theline, (colnr_T)0, FALSE);
-	appended_lines_mark(lnum, 1L);
+	appended_lines_mark(lnum + (empty ? 1 : 0), 1L);
 
 	vim_free(theline);
 	++lnum;