Permalink
Browse files

patch 8.0.0133

Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.
  • Loading branch information...
1 parent 4c8980b commit fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c @brammool brammool committed Dec 11, 2016
Showing with 13 additions and 3 deletions.
  1. +4 −3 src/ex_docmd.c
  2. +7 −0 src/testdir/test_cmdline.vim
  3. +2 −0 src/version.c
View
@@ -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.
*/
@@ -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
View
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 133,
+/**/
132,
/**/
131,

0 comments on commit fe38b49

Please sign in to comment.