mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-06 03:53:59 +02:00
add version number
This commit is contained in:
parent
7add598235
commit
3b264806ef
21
gui.go
21
gui.go
@ -16,6 +16,9 @@ import (
|
|||||||
"github.com/jesseduffield/gocui"
|
"github.com/jesseduffield/gocui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Rev is the release version
|
||||||
|
var Rev string
|
||||||
|
|
||||||
// OverlappingEdges determines if panel edges overlap
|
// OverlappingEdges determines if panel edges overlap
|
||||||
var OverlappingEdges = false
|
var OverlappingEdges = false
|
||||||
|
|
||||||
@ -225,14 +228,28 @@ func layout(g *gocui.Gui) error {
|
|||||||
v.FgColor = gocui.ColorWhite
|
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 {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.BgColor = gocui.ColorDefault
|
v.BgColor = gocui.ColorDefault
|
||||||
v.FgColor = gocui.ColorBlue
|
v.FgColor = gocui.ColorBlue
|
||||||
v.Frame = false
|
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
|
// these are only called once
|
||||||
handleFileSelect(g, filesView)
|
handleFileSelect(g, filesView)
|
||||||
|
Loading…
Reference in New Issue
Block a user