Fix code block rendering
This commit is contained in:
parent
a9199dd9f2
commit
abd21affc4
@ -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 {
|
||||
|
@ -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{}
|
||||
|
Loading…
Reference in New Issue
Block a user