diff --git a/bamboohr/widget.go b/bamboohr/widget.go index bd97ad7a..f464d49f 100644 --- a/bamboohr/widget.go +++ b/bamboohr/widget.go @@ -29,7 +29,7 @@ func (widget *Widget) Refresh() { ) widget.UpdateRefreshedAt() - widget.View.SetTitle(fmt.Sprintf("%s (%d)", widget.Name, len(todayItems))) + widget.View.SetTitle(fmt.Sprintf("%s (%d) ", widget.Name, len(todayItems))) widget.View.SetText(widget.contentFrom(todayItems)) } diff --git a/cmdrunner/widget.go b/cmdrunner/widget.go index 8318bd9a..28c78877 100644 --- a/cmdrunner/widget.go +++ b/cmdrunner/widget.go @@ -42,7 +42,12 @@ func (widget *Widget) Refresh() { func (widget *Widget) String() string { args := strings.Join(widget.args, " ") - return fmt.Sprintf(" %s %s ", widget.cmd, args) + + if args != "" { + return fmt.Sprintf(" %s %s ", widget.cmd, args) + } else { + return fmt.Sprintf(" %s ", widget.cmd) + } } func (widget *Widget) execute() { diff --git a/github/display.go b/github/display.go index b158ee29..a63bc66b 100644 --- a/github/display.go +++ b/github/display.go @@ -14,7 +14,7 @@ func (widget *Widget) display() { return } - widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name, widget.title(repo))) + widget.View.SetTitle(fmt.Sprintf("%s- %s ", widget.Name, widget.title(repo))) str := wtf.SigilStr(len(widget.GithubRepos), widget.Idx, widget.View) + "\n" str = str + " [red]Stats[white]\n" diff --git a/textfile/widget.go b/textfile/widget.go index aee1f660..e929700e 100644 --- a/textfile/widget.go +++ b/textfile/widget.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "path/filepath" "strings" "github.com/gdamore/tcell" @@ -49,7 +50,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget { func (widget *Widget) Refresh() { widget.UpdateRefreshedAt() - widget.View.SetTitle(fmt.Sprintf("%s %s", widget.Name, widget.filePath)) + widget.View.SetTitle(fmt.Sprintf(" %s ", widget.fileName())) filePath, _ := wtf.ExpandHomeDir(widget.filePath) @@ -147,6 +148,10 @@ func (widget *Widget) Refresh() { /* -------------------- Unexported Functions -------------------- */ +func (widget *Widget) fileName() string { + return filepath.Base(widget.filePath) +} + func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { switch string(event.Rune()) { case "/":