0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.4812: unused struct item

Problem:    Unused struct item.
Solution:   Remove "lines" match_T.  Simplify the code. (closes #10256)
This commit is contained in:
zeertzjq
2022-04-23 12:05:51 +01:00
committed by Bram Moolenaar
parent 0de7369fd4
commit 8279cfe499
3 changed files with 4 additions and 7 deletions

View File

@@ -624,10 +624,10 @@ prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum)
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
@@ -673,7 +673,6 @@ prepare_search_hl_line(
shl = &cur->hl;
shl->startcol = MAXCOL;
shl->endcol = MAXCOL;
shl->lines = 0;
shl->attr_cur = 0;
shl->is_addpos = FALSE;
shl->has_cursor = FALSE;
@@ -697,9 +696,6 @@ prepare_search_hl_line(
shl->endcol = shl->rm.endpos[0].col;
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)