vim-patch:8.2.0260: several lines of code are duplicated (#21108)

Problem:    Several lines of code are duplicated.
Solution:   Move duplicated code to a function. (Yegappan Lakshmanan,
            closes vim/vim#5330)

f4140488c7

Using sizeof seems better than ARRAY_SIZE for vim_snprintf().
This commit is contained in:
zeertzjq
2022-11-19 10:57:06 +08:00
committed by GitHub
parent db407010fa
commit f2b30b4d62
5 changed files with 75 additions and 103 deletions

View File

@@ -5164,17 +5164,7 @@ static int bt_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col, bool line_l
static long bt_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col,
proftime_T *tm, int *timed_out)
{
rex.reg_match = NULL;
rex.reg_mmatch = rmp;
rex.reg_buf = buf;
rex.reg_win = win;
rex.reg_firstlnum = lnum;
rex.reg_maxline = rex.reg_buf->b_ml.ml_line_count - lnum;
rex.reg_line_lbr = false;
rex.reg_ic = rmp->rmm_ic;
rex.reg_icombine = false;
rex.reg_maxcol = rmp->rmm_maxcol;
init_regexec_multi(rmp, win, buf, lnum);
return bt_regexec_both(NULL, col, tm, timed_out);
}