To: vim_dev@googlegroups.com Subject: Patch 8.2.4812 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4812 Problem: Unused struct item. Solution: Remove "lines" match_T. Simplify the code. (closes #10256) Files: src/match.c, src/structs.h *** ../vim-8.2.4811/src/match.c 2022-04-22 20:06:55.852991660 +0100 --- src/match.c 2022-04-23 11:42:46.181125895 +0100 *************** *** 624,633 **** static void check_cur_search_hl(win_T *wp, match_T *shl) { ! long 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 || wp->w_cursor.col >= shl->rm.startpos[0].col) && (wp->w_cursor.lnum < shl->lnum + linecount --- 624,633 ---- static void check_cur_search_hl(win_T *wp, match_T *shl) { ! 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 + linecount && (wp->w_cursor.lnum > shl->lnum || wp->w_cursor.col >= shl->rm.startpos[0].col) && (wp->w_cursor.lnum < shl->lnum + linecount *************** *** 673,679 **** shl = &cur->hl; shl->startcol = MAXCOL; shl->endcol = MAXCOL; - shl->lines = 0; shl->attr_cur = 0; shl->is_addpos = FALSE; shl->has_cursor = FALSE; --- 673,678 ---- *************** *** 697,705 **** 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) --- 696,701 ---- *** ../vim-8.2.4811/src/structs.h 2022-04-16 12:03:34.176519007 +0100 --- src/structs.h 2022-04-23 11:42:46.181125895 +0100 *************** *** 3331,3337 **** // found 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 --- 3331,3336 ---- *** ../vim-8.2.4811/src/version.c 2022-04-23 11:08:04.069415342 +0100 --- src/version.c 2022-04-23 11:44:43.085949928 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4812, /**/ -- I wonder how much deeper the ocean would be without sponges. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///