patch 9.0.0407: matchstr() does match column offset

Problem:    matchstr() does match column offset. (Yasuhiro Matsumoto)
Solution:   Accept line number zero. (closes #10938)
This commit is contained in:
Bram Moolenaar
2022-09-07 18:21:24 +01:00
parent 9667b2c888
commit 75a115e8d6
4 changed files with 17 additions and 2 deletions

View File

@ -6778,7 +6778,7 @@ nfa_regmatch(
linenr_T lnum = rex.reg_firstlnum + rex.lnum;
long_u vcol = 0;
if (lnum > 0
if (lnum >= 0
&& lnum <= wp->w_buffer->b_ml.ml_line_count)
vcol = (long_u)win_linetabsize(wp, lnum,
rex.line, col);