mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
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:

committed by
Justin M. Keyes

parent
27356de269
commit
eb40b7ec40
@@ -1665,11 +1665,15 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
||||
ea.addr_count++;
|
||||
|
||||
if (*ea.cmd == ';') {
|
||||
if (!ea.skip)
|
||||
if (!ea.skip) {
|
||||
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;
|
||||
++ea.cmd;
|
||||
}
|
||||
ea.cmd++;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* Don't leave the cursor on an illegal line (caused by ';') */
|
||||
check_cursor_lnum();
|
||||
|
||||
/*
|
||||
* 5. Parse the command.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user