vim-patch:8.0.0133 (#7107)

Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.

fe38b494ff
This commit is contained in:
KunMing Xie 2017-08-02 16:22:04 +08:00 committed by Justin M. Keyes
parent 36a91c790e
commit 348229b1d3
3 changed files with 15 additions and 7 deletions

View File

@ -1665,11 +1665,15 @@ static char_u * do_one_cmd(char_u **cmdlinep,
ea.addr_count++; ea.addr_count++;
if (*ea.cmd == ';') { if (*ea.cmd == ';') {
if (!ea.skip) if (!ea.skip) {
curwin->w_cursor.lnum = ea.line2; curwin->w_cursor.lnum = ea.line2;
} else if (*ea.cmd != ',') // Don't leave the cursor on an illegal line (caused by ';')
check_cursor_lnum();
}
} else if (*ea.cmd != ',') {
break; break;
++ea.cmd; }
ea.cmd++;
} }
/* One address given: set start and end lines */ /* One address given: set start and end lines */
@ -1680,9 +1684,6 @@ static char_u * do_one_cmd(char_u **cmdlinep,
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.
*/ */

View File

@ -232,3 +232,10 @@ func Test_paste_in_cmdline()
call assert_equal('"aaa a;b-c*d bbb', @:) call assert_equal('"aaa a;b-c*d bbb', @:)
bwipe! bwipe!
endfunc endfunc
func Test_illegal_address()
new
2;'(
2;')
quit
endfunc

View File

@ -596,7 +596,7 @@ static const int included_patches[] = {
136, 136,
135, 135,
// 134, // 134,
// 133, 133,
// 132, // 132,
// 131, // 131,
// 130 NA // 130 NA