1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Merge branch 'master' into 157_remove_bom

This commit is contained in:
remyabel
2018-08-16 07:59:31 -04:00
committed by GitHub
50 changed files with 12904 additions and 140 deletions

View File

@ -30,7 +30,13 @@ func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
break
}
if i == len(cyclableViews)-1 {
gui.Log.Info(v.Name() + " is not in the list of views")
message := gui.Tr.TemplateLocalize(
"IssntListOfViews",
Teml{
"name": v.Name(),
},
)
gui.Log.Info(message)
return nil
}
}
@ -53,7 +59,13 @@ func (gui *Gui) previousView(g *gocui.Gui, v *gocui.View) error {
break
}
if i == len(cyclableViews)-1 {
gui.Log.Info(v.Name() + " is not in the list of views")
message := gui.Tr.TemplateLocalize(
"IssntListOfViews",
Teml{
"name": v.Name(),
},
)
gui.Log.Info(message)
return nil
}
}
@ -88,7 +100,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
case "stash":
return gui.handleStashEntrySelect(g, v)
default:
panic("No view matching newLineFocused switch statement")
panic(gui.Tr.SLocalize("NoViewMachingNewLineFocusedSwitchStatement"))
}
}
@ -106,11 +118,23 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
// we should never stack confirmation panels
if oldView != nil && oldView.Name() != "confirmation" {
oldView.Highlight = false
gui.Log.Info("setting previous view to:", oldView.Name())
message := gui.Tr.TemplateLocalize(
"settingPreviewsViewTo",
Teml{
"oldViewName": oldView.Name(),
},
)
gui.Log.Info(message)
gui.State.PreviousView = oldView.Name()
}
newView.Highlight = true
gui.Log.Info("new focused view is " + newView.Name())
message := gui.Tr.TemplateLocalize(
"newFocusedViewIs",
Teml{
"newFocusedView": newView.Name(),
},
)
gui.Log.Info(message)
if _, err := g.SetCurrentView(newView.Name()); err != nil {
return err
}