mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add a helper function to do highlighting in a uniform way
This commit is contained in:
@@ -83,9 +83,8 @@ func (widget *Widget) display() {
|
||||
func (widget *Widget) contentFrom(messages []Message) string {
|
||||
var str string
|
||||
for idx, message := range messages {
|
||||
str += fmt.Sprintf(
|
||||
`["%d"][%s] [blue]%s [lightslategray]%s: [%s]%s [aqua]%s[""]`,
|
||||
idx,
|
||||
row := fmt.Sprintf(
|
||||
`[%s] [blue]%s [lightslategray]%s: [%s]%s [aqua]%s`,
|
||||
widget.RowColor(idx),
|
||||
message.From.DisplayName,
|
||||
message.From.Username,
|
||||
@@ -94,7 +93,7 @@ func (widget *Widget) contentFrom(messages []Message) string {
|
||||
message.Sent.Format("Jan 02, 15:04 MST"),
|
||||
)
|
||||
|
||||
str += "\n"
|
||||
str += wtf.HighlightableHelper(widget.View, row, idx, len(message.Text))
|
||||
}
|
||||
|
||||
return str
|
||||
|
||||
Reference in New Issue
Block a user