From abd21affc42ad65968c946c3bbd6c63eba342981 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 10 Apr 2019 22:59:37 +0300 Subject: Fix code block rendering --- ui/messages/html/text.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui/messages/html/text.go') diff --git a/ui/messages/html/text.go b/ui/messages/html/text.go index b168994..ea8f737 100644 --- a/ui/messages/html/text.go +++ b/ui/messages/html/text.go @@ -70,6 +70,10 @@ func (te *TextEntity) Draw(screen mauview.Screen) { func (te *TextEntity) CalculateBuffer(width, startX int, bare bool) int { te.BaseEntity.CalculateBuffer(width, startX, bare) + if len(te.Text) == 0 { + return te.startX + } + te.height = 0 te.prevWidth = width if te.buffer == nil { te.buffer = []string{} -- cgit v1.2.3