comparison src/regexp_nfa.c @ 30156:d58331e0f14a v9.0.0414

patch 9.0.0414: matchstr() still does not match column offset Commit: https://github.com/vim/vim/commit/753aead960f163d0d3f8ce523ea523f2e0cec06d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 8 12:17:06 2022 +0100 patch 9.0.0414: matchstr() still does not match column offset Problem: matchstr() still does not match column offset when done after a text search. Solution: Only use the line number for a multi-line search. Fix the test. (closes #10938)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Sep 2022 13:30:03 +0200
parents 22a5ccc0d634
children a52697bcffa6
comparison
equal deleted inserted replaced
30155:a85a8accd273 30156:d58331e0f14a
6773 ts = 4; 6773 ts = 4;
6774 result = col > t->state->val * ts; 6774 result = col > t->state->val * ts;
6775 } 6775 }
6776 if (!result) 6776 if (!result)
6777 { 6777 {
6778 linenr_T lnum = rex.reg_firstlnum + rex.lnum; 6778 linenr_T lnum = REG_MULTI
6779 long_u vcol = 0; 6779 ? rex.reg_firstlnum + rex.lnum : 1;
6780 6780 long_u vcol;
6781 if (lnum >= 0 6781
6782 && lnum <= wp->w_buffer->b_ml.ml_line_count) 6782 if (REG_MULTI && (lnum <= 0
6783 vcol = (long_u)win_linetabsize(wp, lnum, 6783 || lnum > wp->w_buffer->b_ml.ml_line_count))
6784 lnum = 1;
6785 vcol = (long_u)win_linetabsize(wp, lnum,
6784 rex.line, col); 6786 rex.line, col);
6785 result = nfa_re_num_cmp(t->state->val, op, vcol + 1); 6787 result = nfa_re_num_cmp(t->state->val, op, vcol + 1);
6786 } 6788 }
6787 if (result) 6789 if (result)
6788 { 6790 {