mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
vim-patch:8.1.0511: ml_get error when calling a function with a range (#9207)
Problem: ml_get error when calling a function with a range.
Solution: Don't position the cursor after the last line.
9e353b5265
This commit is contained in:

committed by
Justin M. Keyes

parent
5320eb57df
commit
f08869cff2
@@ -2728,6 +2728,12 @@ void ex_call(exarg_T *eap)
|
||||
lnum = eap->line1;
|
||||
for (; lnum <= eap->line2; lnum++) {
|
||||
if (eap->addr_count > 0) { // -V560
|
||||
if (lnum > curbuf->b_ml.ml_line_count) {
|
||||
// If the function deleted lines or switched to another buffer
|
||||
// the line number may become invalid.
|
||||
EMSG(_(e_invrange));
|
||||
break;
|
||||
}
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
curwin->w_cursor.col = 0;
|
||||
curwin->w_cursor.coladd = 0;
|
||||
|
Reference in New Issue
Block a user