diff --git a/pkg/gui/controllers/context_lines_controller.go b/pkg/gui/controllers/context_lines_controller.go index 44e191331..bdebd0949 100644 --- a/pkg/gui/controllers/context_lines_controller.go +++ b/pkg/gui/controllers/context_lines_controller.go @@ -94,7 +94,7 @@ func (self *ContextLinesController) applyChange() error { self.c.Toast(fmt.Sprintf(self.c.Tr.DiffContextSizeChanged, self.c.AppState.DiffContextSize)) self.c.SaveAppStateAndLogError() - currentContext := self.c.CurrentStaticContext() + currentContext := self.c.Context().CurrentStatic() switch currentContext.GetKey() { // we make an exception for our staging and patch building contexts because they actually need to refresh their state afterwards. case context.PATCH_BUILDING_MAIN_CONTEXT_KEY: @@ -117,6 +117,6 @@ func (self *ContextLinesController) checkCanChangeContext() error { func (self *ContextLinesController) isShowingDiff() bool { return lo.Contains( CONTEXT_KEYS_SHOWING_DIFFS, - self.c.CurrentStaticContext().GetKey(), + self.c.Context().CurrentStatic().GetKey(), ) } diff --git a/pkg/gui/controllers/helpers/patch_building_helper.go b/pkg/gui/controllers/helpers/patch_building_helper.go index 930aa986a..4c2fc40d0 100644 --- a/pkg/gui/controllers/helpers/patch_building_helper.go +++ b/pkg/gui/controllers/helpers/patch_building_helper.go @@ -41,7 +41,7 @@ func (self *PatchBuildingHelper) Escape() error { func (self *PatchBuildingHelper) Reset() error { self.c.Git().Patch.PatchBuilder.Reset() - if self.c.CurrentStaticContext().GetKind() != types.SIDE_CONTEXT { + if self.c.Context().CurrentStatic().GetKind() != types.SIDE_CONTEXT { if err := self.Escape(); err != nil { return err } diff --git a/pkg/gui/controllers/helpers/staging_helper.go b/pkg/gui/controllers/helpers/staging_helper.go index 9e0e3d73b..5643e47e8 100644 --- a/pkg/gui/controllers/helpers/staging_helper.go +++ b/pkg/gui/controllers/helpers/staging_helper.go @@ -114,9 +114,9 @@ func (self *StagingHelper) handleStagingEscape() error { } func (self *StagingHelper) secondaryStagingFocused() bool { - return self.c.CurrentStaticContext().GetKey() == self.c.Contexts().StagingSecondary.GetKey() + return self.c.Context().CurrentStatic().GetKey() == self.c.Contexts().StagingSecondary.GetKey() } func (self *StagingHelper) mainStagingFocused() bool { - return self.c.CurrentStaticContext().GetKey() == self.c.Contexts().Staging.GetKey() + return self.c.Context().CurrentStatic().GetKey() == self.c.Contexts().Staging.GetKey() } diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper.go b/pkg/gui/controllers/helpers/window_arrangement_helper.go index 322cd1bd6..633ccd8cf 100644 --- a/pkg/gui/controllers/helpers/window_arrangement_helper.go +++ b/pkg/gui/controllers/helpers/window_arrangement_helper.go @@ -90,7 +90,7 @@ func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string, UserConfig: self.c.UserConfig, CurrentWindow: self.windowHelper.CurrentWindow(), CurrentSideWindow: self.c.CurrentSideContext().GetWindowName(), - CurrentStaticWindow: self.c.CurrentStaticContext().GetWindowName(), + CurrentStaticWindow: self.c.Context().CurrentStatic().GetWindowName(), SplitMainPanel: repoState.GetSplitMainPanel(), ScreenMode: repoState.GetScreenMode(), AppStatus: appStatus, diff --git a/pkg/gui/controllers/rename_similarity_threshold_controller.go b/pkg/gui/controllers/rename_similarity_threshold_controller.go index 0b154aa36..f90e32da0 100644 --- a/pkg/gui/controllers/rename_similarity_threshold_controller.go +++ b/pkg/gui/controllers/rename_similarity_threshold_controller.go @@ -82,7 +82,7 @@ func (self *RenameSimilarityThresholdController) applyChange() error { self.c.Toast(fmt.Sprintf(self.c.Tr.RenameSimilarityThresholdChanged, self.c.AppState.RenameSimilarityThreshold)) self.c.SaveAppStateAndLogError() - currentContext := self.c.CurrentStaticContext() + currentContext := self.c.Context().CurrentStatic() switch currentContext.GetKey() { // we make an exception for our files context, because it actually need to refresh its state afterwards. case context.FILES_CONTEXT_KEY: @@ -95,6 +95,6 @@ func (self *RenameSimilarityThresholdController) applyChange() error { func (self *RenameSimilarityThresholdController) isShowingRenames() bool { return lo.Contains( CONTEXT_KEYS_SHOWING_RENAMES, - self.c.CurrentStaticContext().GetKey(), + self.c.Context().CurrentStatic().GetKey(), ) } diff --git a/pkg/gui/extras_panel.go b/pkg/gui/extras_panel.go index 3534dcc69..1083b7ea9 100644 --- a/pkg/gui/extras_panel.go +++ b/pkg/gui/extras_panel.go @@ -15,7 +15,7 @@ func (gui *Gui) handleCreateExtrasMenuPanel() error { { Label: gui.c.Tr.ToggleShowCommandLog, OnPress: func() error { - currentContext := gui.c.CurrentStaticContext() + currentContext := gui.c.Context().CurrentStatic() if gui.c.State().GetShowExtrasWindow() && currentContext.GetKey() == context.COMMAND_LOG_CONTEXT_KEY { if err := gui.c.Context().Pop(); err != nil { return err diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go index a346df509..0628c1b3b 100644 --- a/pkg/gui/gui_common.go +++ b/pkg/gui/gui_common.go @@ -45,10 +45,6 @@ func (self *guiCommon) RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) { return self.gui.runSubprocessWithSuspense(cmdObj) } -func (self *guiCommon) CurrentStaticContext() types.Context { - return self.gui.State.ContextMgr.CurrentStatic() -} - func (self *guiCommon) CurrentSideContext() types.Context { return self.gui.State.ContextMgr.CurrentSide() } diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go index f01108779..2a8971bd6 100644 --- a/pkg/gui/types/common.go +++ b/pkg/gui/types/common.go @@ -57,7 +57,6 @@ type IGuiCommon interface { RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) RunSubprocessAndRefresh(oscommands.ICmdObj) error - CurrentStaticContext() Context CurrentSideContext() Context CurrentPopupContexts() []Context IsCurrentContext(Context) bool diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index deb283fc6..19eb37783 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -119,7 +119,7 @@ func (gui *Gui) handlePrevTab() error { func getTabbedView(gui *Gui) *gocui.View { // It safe assumption that only static contexts have tabs - context := gui.c.CurrentStaticContext() + context := gui.c.Context().CurrentStatic() view, _ := gui.g.View(context.GetViewName()) return view }