vim-patch:8.2.4812: unused struct item

Problem:    Unused struct item.
Solution:   Remove "lines" match_T.  Simplify the code. (closes vim/vim#10256)
8279cfe499
This commit is contained in:
zeertzjq 2022-04-23 19:23:41 +08:00
parent 8db55aedb5
commit 79ab277011
2 changed files with 2 additions and 8 deletions

View File

@ -1020,7 +1020,6 @@ typedef struct {
// match (may continue in next line)
buf_T *buf; // the buffer to search for a match
linenr_T lnum; // the line to search for a match
linenr_T lines; // number of lines starting from lnum
int attr; // attributes to be used for a match
int attr_cur; // attributes currently active in win_line()
linenr_T first_lnum; // first lnum to search for multi-line pat

View File

@ -564,10 +564,10 @@ void prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum)
/// position.
static void check_cur_search_hl(win_T *wp, match_T *shl)
{
long linecount = shl->rm.endpos[0].lnum - shl->rm.startpos[0].lnum;
linenr_T linecount = shl->rm.endpos[0].lnum - shl->rm.startpos[0].lnum;
if (wp->w_cursor.lnum >= shl->lnum
&& wp->w_cursor.lnum <= shl->lnum + shl->rm.endpos[0].lnum
&& wp->w_cursor.lnum <= shl->lnum + linecount
&& (wp->w_cursor.lnum > shl->lnum || wp->w_cursor.col >= shl->rm.startpos[0].col)
&& (wp->w_cursor.lnum < shl->lnum + linecount || wp->w_cursor.col < shl->rm.endpos[0].col)) {
shl->has_cursor = true;
@ -599,7 +599,6 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l
}
shl->startcol = MAXCOL;
shl->endcol = MAXCOL;
shl->lines = 0;
shl->attr_cur = 0;
shl->is_addpos = false;
shl->has_cursor = false;
@ -625,10 +624,6 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l
} else {
shl->endcol = MAXCOL;
}
shl->lines = shl->rm.endpos[0].lnum - shl->rm.startpos[0].lnum;
if (shl->lines == 0) {
shl->lines = 1;
}
// check if the cursor is in the match before changing the columns
if (shl == search_hl) {