mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.0511: ml_get error when calling a function with a range
Problem: ml_get error when calling a function with a range. Solution: Don't position the cursor after the last line.
This commit is contained in:
@@ -3149,6 +3149,13 @@ ex_call(exarg_T *eap)
|
||||
{
|
||||
if (!eap->skip && eap->addr_count > 0)
|
||||
{
|
||||
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;
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
|
Reference in New Issue
Block a user