mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
Fix code block rendering
This commit is contained in:
parent
a9199dd9f2
commit
abd21affc4
2 changed files with 5 additions and 1 deletions
|
@ -48,7 +48,7 @@ func (ce *CodeBlockEntity) Clone() Entity {
|
||||||
|
|
||||||
func (ce *CodeBlockEntity) Draw(screen mauview.Screen) {
|
func (ce *CodeBlockEntity) Draw(screen mauview.Screen) {
|
||||||
screen.Fill(' ', ce.Background)
|
screen.Fill(' ', ce.Background)
|
||||||
ce.BaseEntity.Draw(screen)
|
ce.ContainerEntity.Draw(screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ce *CodeBlockEntity) AdjustStyle(fn AdjustStyleFunc) Entity {
|
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 {
|
func (te *TextEntity) CalculateBuffer(width, startX int, bare bool) int {
|
||||||
te.BaseEntity.CalculateBuffer(width, startX, bare)
|
te.BaseEntity.CalculateBuffer(width, startX, bare)
|
||||||
|
if len(te.Text) == 0 {
|
||||||
|
return te.startX
|
||||||
|
}
|
||||||
|
te.height = 0
|
||||||
te.prevWidth = width
|
te.prevWidth = width
|
||||||
if te.buffer == nil {
|
if te.buffer == nil {
|
||||||
te.buffer = []string{}
|
te.buffer = []string{}
|
||||||
|
|
Loading…
Add table
Reference in a new issue