[vte/vte-0-60] widget: Fix underlining the space character in a matched regex
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-60] widget: Fix underlining the space character in a matched regex
- Date: Wed, 13 May 2020 09:51:38 +0000 (UTC)
commit 14e68fbe47de262e8b25d8bbbf6eef6fd7c28cc2
Author: Egmont Koblinger <egmont gmail com>
Date: Wed May 13 11:46:48 2020 +0200
widget: Fix underlining the space character in a matched regex
https://gitlab.gnome.org/GNOME/vte/-/issues/248
(cherry picked from commit 6a9580bab89c8d82d67cff538e1d0c483c6e142f)
src/vte.cc | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 2e4b9e40..4a457af9 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -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 |
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]