mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
Fixed some sugestions from jesseduffield
This commit is contained in:
parent
61890cb9de
commit
2388c3ee9a
@ -315,10 +315,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
currView := gui.g.CurrentView()
|
currView := gui.g.CurrentView()
|
||||||
currentCyclebleView := "files"
|
currentCyclebleView := gui.State.PreviousView
|
||||||
if currView == nil {
|
if currView != nil {
|
||||||
currentCyclebleView = gui.State.PreviousView
|
|
||||||
} else {
|
|
||||||
viewName := currView.Name()
|
viewName := currView.Name()
|
||||||
usePreviouseView := true
|
usePreviouseView := true
|
||||||
for _, view := range cyclableViews {
|
for _, view := range cyclableViews {
|
||||||
@ -347,10 +345,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
if height < 28 {
|
if height < 28 {
|
||||||
defaultHeight := 3
|
defaultHeight := 3
|
||||||
extraHeight := 2
|
|
||||||
if height < 21 {
|
if height < 21 {
|
||||||
defaultHeight = 1
|
defaultHeight = 1
|
||||||
extraHeight = 0
|
|
||||||
}
|
}
|
||||||
vHeights = map[string]int{
|
vHeights = map[string]int{
|
||||||
"status": defaultHeight,
|
"status": defaultHeight,
|
||||||
@ -360,7 +356,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
"stash": defaultHeight,
|
"stash": defaultHeight,
|
||||||
"options": defaultHeight,
|
"options": defaultHeight,
|
||||||
}
|
}
|
||||||
vHeights[currentCyclebleView] = height - (defaultHeight * 5) + extraHeight
|
vHeights[currentCyclebleView] = height - defaultHeight*4 - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
optionsVersionBoundary := width - max(len(utils.Decolorise(information)), 1)
|
optionsVersionBoundary := width - max(len(utils.Decolorise(information)), 1)
|
||||||
@ -484,7 +480,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if appStatusView, err := g.SetView("appStatus", -1, height+2, width, height, 0); err != nil {
|
if appStatusView, err := g.SetView("appStatus", -1, height-2, width, height, 0); err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if err.Error() != "unknown view" {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -496,7 +492,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, err := g.SetView("information", optionsVersionBoundary-1, height+2, width, height, 0); err != nil {
|
if v, err := g.SetView("information", optionsVersionBoundary-1, height-2, width, height, 0); err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if err.Error() != "unknown view" {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user