From b76c301145c543ebcdc5534d4f292b056aa51219 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 17 Jun 2019 13:46:02 +0300 Subject: Add initial support for rendering replies --- ui/messages/textmessage.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ui/messages/textmessage.go') diff --git a/ui/messages/textmessage.go b/ui/messages/textmessage.go index 5527677..2e27e33 100644 --- a/ui/messages/textmessage.go +++ b/ui/messages/textmessage.go @@ -29,9 +29,10 @@ import ( ) type TextMessage struct { - cache tstring.TString - buffer []tstring.TString - Text string + cache tstring.TString + buffer []tstring.TString + isHighlight bool + Text string } // NewTextMessage creates a new UITextMessage object with the provided values and the default state. @@ -85,6 +86,9 @@ func (msg *TextMessage) String() string { } func (msg *TextMessage) CalculateBuffer(prefs config.UserPreferences, width int, uiMsg *UIMessage) { + if uiMsg.IsHighlight != msg.isHighlight { + msg.cache = nil + } msg.buffer = calculateBufferWithText(prefs, msg.getCache(uiMsg), width, uiMsg) } -- cgit v1.2.3