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

Now possible to define the characters for use in paging indicators

This commit is contained in:
Chris Cummer
2018-05-24 09:03:00 -07:00
parent 0cdd859aa7
commit 5f7c3260c1
4 changed files with 17 additions and 43 deletions

View File

@@ -20,7 +20,7 @@ func (widget *Widget) display() {
title := fmt.Sprintf("[green]%s[white]\n", repoData.Repository)
widget.View.SetTitle(fmt.Sprintf(" Git: %s ", title))
str := widget.tickMarks(widget.Data) + "\n"
str := wtf.SygilStr(len(widget.Data), widget.Idx, widget.View) + "\n"
str = str + " [red]Branch[white]\n"
str = str + fmt.Sprintf(" %s", repoData.Branch)
str = str + "\n"
@@ -83,16 +83,3 @@ func (widget *Widget) formatCommits(data []string) string {
func (widget *Widget) formatCommit(line string) string {
return fmt.Sprintf(" %s\n", strings.Replace(line, "\"", "", -1))
}
func (widget *Widget) tickMarks(data []*GitRepo) string {
str := ""
if len(data) > 1 {
marks := strings.Repeat("*", len(data))
marks = marks[:widget.Idx] + "_" + marks[widget.Idx+1:]
str = "[lightblue]" + fmt.Sprintf(wtf.RightAlignFormat(widget.View), marks) + "[white]"
}
return str
}