mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +02:00
Merge pull request #195 from jesseduffield/hotfix/194-support-empty-version
194: Support empty version string
This commit is contained in:
@ -141,14 +141,15 @@ func max(a, b int) int {
|
|||||||
func (gui *Gui) layout(g *gocui.Gui) error {
|
func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
g.Highlight = true
|
g.Highlight = true
|
||||||
width, height := g.Size()
|
width, height := g.Size()
|
||||||
|
version := gui.Config.GetVersion()
|
||||||
leftSideWidth := width / 3
|
leftSideWidth := width / 3
|
||||||
statusFilesBoundary := 2
|
statusFilesBoundary := 2
|
||||||
filesBranchesBoundary := 2 * height / 5 // height - 20
|
filesBranchesBoundary := 2 * height / 5 // height - 20
|
||||||
commitsBranchesBoundary := 3 * height / 5 // height - 10
|
commitsBranchesBoundary := 3 * height / 5 // height - 10
|
||||||
commitsStashBoundary := height - 5 // height - 5
|
commitsStashBoundary := height - 5 // height - 5
|
||||||
|
optionsVersionBoundary := width - max(len(version), 1)
|
||||||
minimumHeight := 16
|
minimumHeight := 16
|
||||||
minimumWidth := 10
|
minimumWidth := 10
|
||||||
version := gui.Config.GetVersion()
|
|
||||||
|
|
||||||
panelSpacing := 1
|
panelSpacing := 1
|
||||||
if OverlappingEdges {
|
if OverlappingEdges {
|
||||||
@ -227,7 +228,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
v.FgColor = gocui.ColorWhite
|
v.FgColor = gocui.ColorWhite
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, err := g.SetView("options", -1, optionsTop, width-len(version)-2, optionsTop+2, 0); err != nil {
|
if v, err := g.SetView("options", -1, optionsTop, optionsVersionBoundary-1, optionsTop+2, 0); err != nil {
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -249,8 +250,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
commitMessageView.Editable = true
|
commitMessageView.Editable = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if v, err := g.SetView("version", optionsVersionBoundary-1, optionsTop, width, optionsTop+2, 0); err != nil {
|
||||||
if v, err := g.SetView("version", width-len(version)-1, optionsTop, width, optionsTop+2, 0); err != nil {
|
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user