Patch 7.3.251 inadvertently changed how C behaves on the last line of
the file, when it is blank.  Given this command

  vim -u NONE -N -c 'call setline("$", ["11", ""])' -c 'call feedkeys("GC")'

pre-7.3.251 would simply leave the cursor in insert mode on line 2.
After 7.3.251, line 2 is deleted and the cursor is in insert mode at the
*start* of line 1.

Since 7.3.251 was just supposed to special case for gH<Del>, the
attached patch verifies the op is OP_DELETE before using the new
behavior.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -1922,7 +1922,8 @@
 		    curwin->w_cursor.coladd = 0;
 	    }
 #endif
-	    if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
+	    if (oap->op_type == OP_DELETE && oap->inclusive
+		    && oap->end.lnum == curbuf->b_ml.ml_line_count
 		    && n > (int)STRLEN(ml_get(oap->end.lnum)))
 	    {
 		/* Special case: gH<Del> deletes the last line. */

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui