diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-08 08:58:24 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-08 08:58:24 +1000 |
commit | 5ca47c3f471365b915ca4e9a6cb3c4bf42ccc786 (patch) | |
tree | 714f3d0090ae3278e8a2f6db41607b9c46eea70e /gui.go | |
parent | 30d79bfa2cd17f47fd6b0b547746eb7bd69e4ef5 (diff) | |
parent | 3b264806ef14dcdddaa429acc2bcc10cc37cd9cb (diff) |
merge master
Diffstat (limited to 'gui.go')
-rw-r--r-- | gui.go | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -225,14 +225,28 @@ func layout(g *gocui.Gui) error { v.FgColor = gocui.ColorWhite } - if v, err := g.SetView("options", -1, optionsTop, width, optionsTop+2, 0); err != nil { + version := Rev + if version == "" { + version = "unversioned" + } + + if v, err := g.SetView("options", -1, optionsTop, width-len(version)-2, optionsTop+2, 0); err != nil { if err != gocui.ErrUnknownView { return err } v.BgColor = gocui.ColorDefault v.FgColor = gocui.ColorBlue v.Frame = false - v.Title = "Options" + } + + if v, err := g.SetView("version", width-len(version)-1, optionsTop, width, optionsTop+2, 0); err != nil { + if err != gocui.ErrUnknownView { + return err + } + v.BgColor = gocui.ColorDefault + v.FgColor = gocui.ColorGreen + v.Frame = false + renderString(g, "version", version) // these are only called once handleFileSelect(g, filesView) |