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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user