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:
@@ -75,15 +75,14 @@ func (widget *Widget) contentFrom(view *View) string {
|
||||
var validID = regexp.MustCompile(widget.settings.jobNameRegex)
|
||||
|
||||
if validID.MatchString(job.Name) {
|
||||
str += fmt.Sprintf(
|
||||
`["%d"][%s] [%s]%-6s[white][""]`,
|
||||
idx,
|
||||
row := fmt.Sprintf(
|
||||
`[%s] [%s]%-6s[white]`,
|
||||
widget.RowColor(idx),
|
||||
widget.jobColor(&job),
|
||||
job.Name,
|
||||
)
|
||||
|
||||
str += "\n"
|
||||
str += wtf.HighlightableHelper(widget.View, row, idx, len(job.Name))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user