diff src/ex_docmd.c @ 10480:dc9326b58c33 v8.0.0133

commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 11 21:34:23 2016 +0100 patch 8.0.0133 Problem: "2;'(" causes ml_get errors in an empty buffer. (Dominique Pelle) Solution: Check the cursor line earlier.
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Dec 2016 21:45:04 +0100
parents b59df2194b01
children c7de1536780a
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2277,7 +2277,11 @@ do_one_cmd(
 	if (*ea.cmd == ';')
 	{
 	    if (!ea.skip)
+	    {
 		curwin->w_cursor.lnum = ea.line2;
+		/* don't leave the cursor on an illegal line */
+		check_cursor_lnum();
+	    }
 	}
 	else if (*ea.cmd != ',')
 	    break;
@@ -2293,9 +2297,6 @@ do_one_cmd(
 	    ea.addr_count = 0;
     }
 
-    /* Don't leave the cursor on an illegal line (caused by ';') */
-    check_cursor_lnum();
-
 /*
  * 5. Parse the command.
  */