Fix marking of text not working on lines that contain zero cells

Zero cells are passed to the regex engine as spaces, so they must
increment the match_pos counter. Fixes #3403
This commit is contained in:
Kovid Goyal
2021-03-23 10:04:58 +05:30
parent c0ec60c113
commit 11268ffa16
3 changed files with 11 additions and 1 deletions

View File

@@ -736,8 +736,8 @@ apply_mark(Line *line, const attrs_type mark, index_type *cell_pos, unsigned int
#define MARK { line->gpu_cells[x].attrs &= ATTRS_MASK_WITHOUT_MARK; line->gpu_cells[x].attrs |= mark; }
index_type x = *cell_pos;
MARK;
(*match_pos)++;
if (line->cpu_cells[x].ch) {
(*match_pos)++;
if (line->cpu_cells[x].ch == '\t') {
unsigned num_cells_to_skip_for_tab = line->cpu_cells[x].cc_idx[0];
while (num_cells_to_skip_for_tab && x + 1 < line->xnum && line->cpu_cells[x+1].ch == ' ') {