From 36d1713b0973e1aa2ab2de6343f1185a70f62a0d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 13 Dec 2022 12:14:29 +1100 Subject: [PATCH] Fix a couple bugs with underline highlighting Add missing curly_underline attribute to json-rpc Fix underline color not correct after attrbute only change --- src/json_ui.cc | 1 + src/terminal_ui.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json_ui.cc b/src/json_ui.cc index f5ae1f1f..8f0af46d 100644 --- a/src/json_ui.cc +++ b/src/json_ui.cc @@ -38,6 +38,7 @@ String to_json(Attribute attributes) struct Attr { Attribute attr; StringView name; } attrs[] { { Attribute::Underline, "underline" }, + { Attribute::CurlyUnderline, "curly_underline" }, { Attribute::Reverse, "reverse" }, { Attribute::Blink, "blink" }, { Attribute::Bold, "bold" }, diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index b788dbe8..9d6cf4b0 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -247,7 +247,7 @@ void TerminalUI::Screen::set_face(const Face& face, Writer& writer) if (face.attributes & (Attribute)(1 << i)) format_with(writer, ";{}", attr_table[i]); } - m_active_face.fg = m_active_face.bg = Color::Default; + m_active_face.fg = m_active_face.bg = m_active_face.underline = Color::Default; join = true; } if (m_active_face.fg != face.fg)