mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
vim-patch:9.0.1011: ml_get error when using screenpos()
Problem: ml_get error when using screenpos().
Solution: Give an error for the line number. (closes vim/vim#11661)
99d19438ca
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -996,6 +996,10 @@ void f_screenpos(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
.col = (colnr_T)tv_get_number(&argvars[2]) - 1,
|
||||
.coladd = 0
|
||||
};
|
||||
if (pos.lnum > wp->w_buffer->b_ml.ml_line_count) {
|
||||
semsg(_(e_invalid_line_number_nr), pos.lnum);
|
||||
return;
|
||||
}
|
||||
int row = 0;
|
||||
int scol = 0, ccol = 0, ecol = 0;
|
||||
textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol, false);
|
||||
|
Reference in New Issue
Block a user