Skip to content

Commit

Permalink
patch 8.0.0133
Browse files Browse the repository at this point in the history
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.
  • Loading branch information
brammool committed Dec 11, 2016
1 parent 4c8980b commit fe38b49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ex_docmd.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2277,7 +2277,11 @@ do_one_cmd(
if (*ea.cmd == ';') if (*ea.cmd == ';')
{ {
if (!ea.skip) if (!ea.skip)
{
curwin->w_cursor.lnum = ea.line2; curwin->w_cursor.lnum = ea.line2;
/* don't leave the cursor on an illegal line */
check_cursor_lnum();
}
} }
else if (*ea.cmd != ',') else if (*ea.cmd != ',')
break; break;
Expand All @@ -2293,9 +2297,6 @@ do_one_cmd(
ea.addr_count = 0; ea.addr_count = 0;
} }


/* Don't leave the cursor on an illegal line (caused by ';') */
check_cursor_lnum();

/* /*
* 5. Parse the command. * 5. Parse the command.
*/ */
Expand Down
7 changes: 7 additions & 0 deletions src/testdir/test_cmdline.vim
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -234,3 +234,10 @@ func Test_remove_char_in_cmdline()
call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx') call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
call assert_equal('"def', @:) call assert_equal('"def', @:)
endfunc endfunc

func Test_illegal_address()
new
2;'(
2;')
quit
endfunc
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
133,
/**/ /**/
132, 132,
/**/ /**/
Expand Down

0 comments on commit fe38b49

Please sign in to comment.