1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-01 22:52:01 +02:00

more support for command log and more code reuse for contexts

This commit is contained in:
Jesse Duffield
2021-04-11 13:17:20 +10:00
parent 4f03d7733a
commit cf78b86cb5
9 changed files with 753 additions and 721 deletions

View File

@@ -3,12 +3,20 @@ package gui
func (gui *Gui) handleCreateExtrasMenuPanel() error {
menuItems := []*menuItem{
{
displayString: "Toggle show/hide command log",
displayString: gui.Tr.ToggleShowCommandLog,
onPress: func() error {
gui.ShowExtrasWindow = !gui.ShowExtrasWindow
return nil
},
},
{
displayString: gui.Tr.FocusCommandLog,
onPress: func() error {
gui.ShowExtrasWindow = true
gui.State.Contexts.CommandLog.SetParentContext(gui.currentSideContext())
return gui.pushContext(gui.State.Contexts.CommandLog)
},
},
}
return gui.createMenu(gui.Tr.DiffingMenuTitle, menuItems, createMenuOptions{showCancel: true})