comparison src/drawline.c @ 26334:baec4e1cee43 v8.2.3698

patch 8.2.3698: match highlighting continues over breakindent Commit: https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 29 19:18:57 2021 +0000 patch 8.2.3698: match highlighting continues over breakindent Problem: Match highlighting continues over breakindent. Solution: Stop before the end column. (closes https://github.com/vim/vim/issues/9242)
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Nov 2021 20:30:04 +0100
parents 365e7f083f02
children 4cf208415483
comparison
equal deleted inserted replaced
26333:ecabeda57f71 26334:baec4e1cee43
432 #endif 432 #endif
433 int screen_line_flags = 0; 433 int screen_line_flags = 0;
434 434
435 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) 435 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA)
436 int match_conc = 0; // cchar for match functions 436 int match_conc = 0; // cchar for match functions
437 int on_last_col = FALSE;
437 #endif 438 #endif
438 #ifdef FEAT_CONCEAL 439 #ifdef FEAT_CONCEAL
439 int syntax_flags = 0; 440 int syntax_flags = 0;
440 int syntax_seqnr = 0; 441 int syntax_seqnr = 0;
441 int prev_syntax_id = 0; 442 int prev_syntax_id = 0;
1380 // After end, check for start/end of next match. 1381 // After end, check for start/end of next match.
1381 // When another match, have to check for start again. 1382 // When another match, have to check for start again.
1382 v = (long)(ptr - line); 1383 v = (long)(ptr - line);
1383 search_attr = update_search_hl(wp, lnum, (colnr_T)v, &line, 1384 search_attr = update_search_hl(wp, lnum, (colnr_T)v, &line,
1384 &screen_search_hl, &has_match_conc, 1385 &screen_search_hl, &has_match_conc,
1385 &match_conc, did_line_attr, lcs_eol_one); 1386 &match_conc, did_line_attr, lcs_eol_one,
1387 &on_last_col);
1386 ptr = line + v; // "line" may have been changed 1388 ptr = line + v; // "line" may have been changed
1387 1389
1388 // Do not allow a conceal over EOL otherwise EOL will be missed 1390 // Do not allow a conceal over EOL otherwise EOL will be missed
1389 // and bad things happen. 1391 // and bad things happen.
1390 if (*ptr == NUL) 1392 if (*ptr == NUL)
2010 { 2012 {
2011 n_extra -= MB_CHARLEN(get_showbreak_value(wp)); 2013 n_extra -= MB_CHARLEN(get_showbreak_value(wp));
2012 if (n_extra < 0) 2014 if (n_extra < 0)
2013 n_extra = 0; 2015 n_extra = 0;
2014 } 2016 }
2017 if (on_last_col)
2018 // Do not continue search/match highlighting over the
2019 // line break.
2020 search_attr = 0;
2015 2021
2016 if (c == TAB && n_extra + col > wp->w_width) 2022 if (c == TAB && n_extra + col > wp->w_width)
2017 # ifdef FEAT_VARTABS 2023 # ifdef FEAT_VARTABS
2018 n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts, 2024 n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,
2019 wp->w_buffer->b_p_vts_array) - 1; 2025 wp->w_buffer->b_p_vts_array) - 1;