summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-26 16:33:52 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commitf2c85c5b19176a959ac5d98f57749ee6bc9c362b (patch)
tree4e9578df83dd22464d62deaaf816b4811d2bdf18 /pkg/gui/controllers.go
parent0faa41e6f8e13818c611ad923fa424c83653d06a (diff)
move side window actions to controllers package
Diffstat (limited to 'pkg/gui/controllers.go')
-rw-r--r--pkg/gui/controllers.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/gui/controllers.go b/pkg/gui/controllers.go
index b4af4db7a..88b9dee2e 100644
--- a/pkg/gui/controllers.go
+++ b/pkg/gui/controllers.go
@@ -161,6 +161,27 @@ func (gui *Gui) resetControllers() {
commandLogController := controllers.NewCommandLogController(common)
confirmationController := controllers.NewConfirmationController(common)
suggestionsController := controllers.NewSuggestionsController(common)
+ jumpToSideWindowController := controllers.NewJumpToSideWindowController(common)
+
+ sideWindowControllerFactory := controllers.NewSideWindowControllerFactory(common)
+
+ // allow for navigating between side window contexts
+ for _, context := range []types.Context{
+ gui.State.Contexts.Status,
+ gui.State.Contexts.Remotes,
+ gui.State.Contexts.Tags,
+ gui.State.Contexts.Branches,
+ gui.State.Contexts.RemoteBranches,
+ gui.State.Contexts.Files,
+ gui.State.Contexts.Submodules,
+ gui.State.Contexts.ReflogCommits,
+ gui.State.Contexts.LocalCommits,
+ gui.State.Contexts.CommitFiles,
+ gui.State.Contexts.SubCommits,
+ gui.State.Contexts.Stash,
+ } {
+ controllers.AttachControllers(context, sideWindowControllerFactory.Create(context))
+ }
setSubCommits := func(commits []*models.Commit) {
gui.Mutexes.SubCommitsMutex.Lock()
@@ -306,6 +327,7 @@ func (gui *Gui) resetControllers() {
undoController,
globalController,
contextLinesController,
+ jumpToSideWindowController,
)
controllers.AttachControllers(gui.State.Contexts.Snake,