aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-08-02 16:22:04 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-08-04 22:25:39 +0200
commit348229b1d32010292013eee415c28926e2b7009b (patch)
tree0d121a10b5f9c8b845175883b70c6622a76a63ba /src/nvim/ex_docmd.c
parent36a91c790e5b58a002ca20671a357d8a0ffd2dff (diff)
downloadrneovim-348229b1d32010292013eee415c28926e2b7009b.tar.gz
rneovim-348229b1d32010292013eee415c28926e2b7009b.tar.bz2
rneovim-348229b1d32010292013eee415c28926e2b7009b.zip
vim-patch:8.0.0133 (#7107)
Problem: "2;'(" causes ml_get errors in an empty buffer. (Dominique Pelle) Solution: Check the cursor line earlier. https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 30156621d6..d1ce589db1 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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.
*/