diff options
author | Egmont Koblinger <egmont@gmail.com> | 2020-05-13 11:46:48 +0200 |
---|---|---|
committer | Egmont Koblinger <egmont@gmail.com> | 2020-05-13 11:51:07 +0200 |
commit | 14e68fbe47de262e8b25d8bbbf6eef6fd7c28cc2 (patch) | |
tree | aea4e15f835d2707718d9f8fe58a255d31a9339c | |
parent | 7e6442233e24141eb8ce92e96587c2c8df159b98 (diff) | |
download | vte-0.60.3.tar.gz |
widget: Fix underlining the space character in a matched regex0.60.3
https://gitlab.gnome.org/GNOME/vte/-/issues/248
(cherry picked from commit 6a9580bab89c8d82d67cff538e1d0c483c6e142f)
-rw-r--r-- | src/vte.cc | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -8760,7 +8760,8 @@ Terminal::draw_rows(VteScreen *screen_, vte::grid::column_t i, j, lcol, vcol; int y; guint fore = VTE_DEFAULT_FG, nfore, back = VTE_DEFAULT_BG, nback, deco = VTE_DEFAULT_FG, ndeco; - gboolean hyperlink = FALSE, nhyperlink, hilite = FALSE, nhilite; + gboolean hyperlink = FALSE, nhyperlink; /* non-hovered explicit hyperlink, needs dashed underlining */ + gboolean hilite = FALSE, nhilite; /* hovered explicit hyperlink or regex match, needs continuous underlining */ gboolean selected; gboolean nrtl = FALSE, rtl; /* for debugging */ uint32_t attr = 0, nattr; @@ -8938,12 +8939,15 @@ Terminal::draw_rows(VteScreen *screen_, g_assert(cell != nullptr); nhyperlink = (m_allow_hyperlink && cell->attr.hyperlink_idx != 0); + nhilite = (nhyperlink && cell->attr.hyperlink_idx == m_hyperlink_hover_idx) || + (!nhyperlink && regex_match_has_current() && m_match_span.contains(row, lcol)); if (cell->c == 0 || ((cell->c == ' ' || cell->c == '\t') && // FIXME '\t' is newly added now, double check cell->attr.has_none(VTE_ATTR_UNDERLINE_MASK | VTE_ATTR_STRIKETHROUGH_MASK | VTE_ATTR_OVERLINE_MASK) && - !nhyperlink) || + !nhyperlink && + !nhilite) || cell->attr.fragment() || cell->attr.invisible()) { /* Skip empty or fragment cell. */ @@ -8956,9 +8960,6 @@ Terminal::draw_rows(VteScreen *screen_, selected = cell_is_selected_log(lcol, row); determine_colors(cell, selected, &nfore, &nback, &ndeco); - nhilite = (nhyperlink && cell->attr.hyperlink_idx == m_hyperlink_hover_idx) || - (!nhyperlink && regex_match_has_current() && m_match_span.contains(row, lcol)); - /* See if it no longer fits the run. */ if (item_count > 0 && (((attr ^ nattr) & (VTE_ATTR_BOLD_MASK | |