1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Prevent extra empty line in highlightable text

This commit is contained in:
Ying Fan Chong 2020-10-02 20:53:33 +08:00
parent 9a366ffeb9
commit 0f36063696

View File

@ -1,6 +1,8 @@
package view
import (
"strings"
"github.com/rivo/tview"
"github.com/wtfutil/wtf/cfg"
"github.com/wtfutil/wtf/wtf"
@ -36,7 +38,7 @@ func (widget *TextWidget) Redraw(data func() (string, string, bool)) {
widget.View.Clear()
widget.View.SetWrap(wrap)
widget.View.SetTitle(widget.ContextualTitle(title))
widget.View.SetText(content)
widget.View.SetText(strings.TrimSpace(content))
})
}