1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

add global controller

This commit is contained in:
Jesse Duffield
2022-02-05 11:00:57 +11:00
parent 226985bf76
commit 8e3484d8e9
5 changed files with 79 additions and 43 deletions

View File

@ -222,6 +222,7 @@ type Controllers struct {
Bisect *controllers.BisectController
Undo *controllers.UndoController
Sync *controllers.SyncController
Global *controllers.GlobalController
}
type listPanelState struct {
@ -591,6 +592,10 @@ func (gui *Gui) resetControllers() {
gui.Controllers = Controllers{
Submodules: submodulesController,
Global: controllers.NewGlobalController(
controllerCommon,
osCommand,
),
Files: controllers.NewFilesController(
controllerCommon,
gui.State.Contexts.Files,
@ -674,6 +679,7 @@ func (gui *Gui) resetControllers() {
}
gui.State.Contexts.Submodules.AddKeybindingsFn(gui.Controllers.Submodules.GetKeybindings)
gui.Controllers.Files.Attach(gui.State.Contexts.Files)
gui.State.Contexts.Files.AddKeybindingsFn(gui.Controllers.Files.GetKeybindings)
gui.State.Contexts.Tags.AddKeybindingsFn(gui.Controllers.Tags.GetKeybindings)
// TODO: commit to one name here: local commits or branch commits