]> granicus.if.org Git - vim/commitdiff
patch 8.0.0133 v8.0.0133
authorBram Moolenaar <Bram@vim.org>
Sun, 11 Dec 2016 20:34:23 +0000 (21:34 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 11 Dec 2016 20:34:23 +0000 (21:34 +0100)
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.

src/ex_docmd.c
src/testdir/test_cmdline.vim
src/version.c

index 439467cf112853db4c651bc6e64d79d11fd53622..2b0f15ee9d9c3ecc3f8eb326e6826f56eef0e905 100644 (file)
@@ -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.
  */
index c48a8117f57cdddcb52c71bcf98b4ff081e2acee..96fee0b1c899a0f014dff705abfc845575b19de5 100644 (file)
@@ -234,3 +234,10 @@ func Test_remove_char_in_cmdline()
   call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
   call assert_equal('"def', @:)
 endfunc
+
+func Test_illegal_address()
+  new
+  2;'(
+  2;')
+  quit
+endfunc
index b21e60a664ec7c378419d5bf64123d998d9bc32b..2e3cb057e979349bcf0fc3e7ec6ed0d4a8d61599 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    133,
 /**/
     132,
 /**/