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

Merge branch 'master' into configdocs

This commit is contained in:
Chris Cummer
2019-05-25 10:17:18 -07:00
committed by GitHub
17 changed files with 36 additions and 65 deletions

View File

@@ -9,6 +9,7 @@ import (
"strconv"
"strings"
"github.com/rivo/tview"
"github.com/wtfutil/wtf/utils"
)
@@ -198,3 +199,12 @@ func ToStrs(slice []interface{}) []string {
return results
}
func HighlightableHelper(view *tview.TextView, input string, idx, offset int) string {
fmtStr := fmt.Sprintf(`["%d"][""]`, idx)
_, _, w, _ := view.GetInnerRect()
fmtStr += input
fmtStr += PadRow(offset, w+1)
fmtStr += `[""]` + "\n"
return fmtStr
}