summaryrefslogtreecommitdiff
path: root/src/regexp_bt.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-07 18:21:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-07 18:21:24 +0100
commit75a115e8d632e96b4f45dc5145ba261876a83dcf (patch)
tree31b49d9c295e0732eea955233ab1d0cbd7e9a649 /src/regexp_bt.c
parent9667b2c888351b04751bdb43cba0d4ffc8c13ab1 (diff)
downloadvim-git-75a115e8d632e96b4f45dc5145ba261876a83dcf.tar.gz
patch 9.0.0407: matchstr() does match column offsetv9.0.0407
Problem: matchstr() does match column offset. (Yasuhiro Matsumoto) Solution: Accept line number zero. (closes #10938)
Diffstat (limited to 'src/regexp_bt.c')
-rw-r--r--src/regexp_bt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regexp_bt.c b/src/regexp_bt.c
index cf484e0ba..e3e7a1801 100644
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -3444,7 +3444,7 @@ regmatch(
linenr_T lnum = rex.reg_firstlnum + rex.lnum;
long_u vcol = 0;
- if (lnum > 0 && lnum <= wp->w_buffer->b_ml.ml_line_count)
+ if (lnum >= 0 && lnum <= wp->w_buffer->b_ml.ml_line_count)
vcol = (long_u)win_linetabsize(wp, lnum, rex.line,
(colnr_T)(rex.input - rex.line));
if (!re_num_cmp(vcol + 1, scan))