mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
Replace CurrentContext() with Context().Current()
This commit is contained in:
@ -431,7 +431,7 @@ func (self *ConfirmationHelper) IsPopupPanel(context types.Context) bool {
|
||||
}
|
||||
|
||||
func (self *ConfirmationHelper) IsPopupPanelFocused() bool {
|
||||
return self.IsPopupPanel(self.c.CurrentContext())
|
||||
return self.IsPopupPanel(self.c.Context().Current())
|
||||
}
|
||||
|
||||
func (self *ConfirmationHelper) TooltipForMenuItem(menuItem *types.MenuItem) string {
|
||||
|
@ -93,7 +93,7 @@ func (self *DiffHelper) currentDiffTerminal() string {
|
||||
}
|
||||
|
||||
func (self *DiffHelper) currentlySelectedFilename() string {
|
||||
currentContext := self.c.CurrentContext()
|
||||
currentContext := self.c.Context().Current()
|
||||
|
||||
switch currentContext := currentContext.(type) {
|
||||
case types.IListContext:
|
||||
|
@ -123,7 +123,7 @@ func (self *MergeConflictsHelper) RefreshMergeState() error {
|
||||
self.c.Contexts().MergeConflicts.GetMutex().Lock()
|
||||
defer self.c.Contexts().MergeConflicts.GetMutex().Unlock()
|
||||
|
||||
if self.c.CurrentContext().GetKey() != context.MERGE_CONFLICTS_CONTEXT_KEY {
|
||||
if self.c.Context().Current().GetKey() != context.MERGE_CONFLICTS_CONTEXT_KEY {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ func (self *PatchBuildingHelper) Reset() error {
|
||||
}
|
||||
|
||||
// refreshing the current context so that the secondary panel is hidden if necessary.
|
||||
return self.c.PostRefreshUpdate(self.c.CurrentContext())
|
||||
return self.c.PostRefreshUpdate(self.c.Context().Current())
|
||||
}
|
||||
|
||||
func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpts) error {
|
||||
|
@ -109,7 +109,7 @@ func (self *RefsHelper) CheckoutRemoteBranch(fullBranchName string, localBranchN
|
||||
checkout := func(branchName string) error {
|
||||
// Switch to the branches context _before_ starting to check out the
|
||||
// branch, so that we see the inline status
|
||||
if self.c.CurrentContext() != self.c.Contexts().Branches {
|
||||
if self.c.Context().Current() != self.c.Contexts().Branches {
|
||||
if err := self.c.Context().Push(self.c.Contexts().Branches); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -292,7 +292,7 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest
|
||||
return err
|
||||
}
|
||||
|
||||
if self.c.CurrentContext() != self.c.Contexts().Branches {
|
||||
if self.c.Context().Current() != self.c.Contexts().Branches {
|
||||
if err := self.c.Context().Push(self.c.Contexts().Branches); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ func (self *SearchHelper) ReApplySearch(ctx types.Context) {
|
||||
if ctx == state.Context {
|
||||
// Re-render the "x of y" search status, unless the search prompt is
|
||||
// open for typing.
|
||||
if self.c.CurrentContext().GetKey() != context.SEARCH_CONTEXT_KEY {
|
||||
if self.c.Context().Current().GetKey() != context.SEARCH_CONTEXT_KEY {
|
||||
self.RenderSearchStatus(searchableContext)
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func (self *WindowHelper) windowViewNameMap() *utils.ThreadSafeMap[string, strin
|
||||
}
|
||||
|
||||
func (self *WindowHelper) CurrentWindow() string {
|
||||
return self.c.CurrentContext().GetWindowName()
|
||||
return self.c.Context().Current().GetWindowName()
|
||||
}
|
||||
|
||||
// assumes the context's windowName has been set to the new window if necessary
|
||||
|
Reference in New Issue
Block a user