aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/messages/html/codeblock.go2
-rw-r--r--ui/messages/html/text.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/ui/messages/html/codeblock.go b/ui/messages/html/codeblock.go
index 7f6b462..aee2bb4 100644
--- a/ui/messages/html/codeblock.go
+++ b/ui/messages/html/codeblock.go
@@ -48,7 +48,7 @@ func (ce *CodeBlockEntity) Clone() Entity {
func (ce *CodeBlockEntity) Draw(screen mauview.Screen) {
screen.Fill(' ', ce.Background)
- ce.BaseEntity.Draw(screen)
+ ce.ContainerEntity.Draw(screen)
}
func (ce *CodeBlockEntity) AdjustStyle(fn AdjustStyleFunc) Entity {
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{}