mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
show namesake for child views
This commit is contained in:
@ -497,9 +497,7 @@ func (self *LocalCommitsController) createFixupCommit(commit *models.Commit) err
|
||||
func (self *LocalCommitsController) squashAllAboveFixupCommits(commit *models.Commit) error {
|
||||
prompt := utils.ResolvePlaceholderString(
|
||||
self.c.Tr.SureSquashAboveCommits,
|
||||
map[string]string{
|
||||
"commit": commit.Sha,
|
||||
},
|
||||
map[string]string{"commit": commit.Sha},
|
||||
)
|
||||
|
||||
return self.c.Ask(types.AskOpts{
|
||||
@ -561,7 +559,9 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
|
||||
}
|
||||
|
||||
return self.c.WithWaitingStatus(self.c.Tr.LcLoadingCommits, func() error {
|
||||
return self.c.Refresh(types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.COMMITS}})
|
||||
return self.c.Refresh(
|
||||
types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.COMMITS}},
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
@ -602,7 +602,12 @@ func (self *LocalCommitsController) handleOpenLogMenu() error {
|
||||
return func() error {
|
||||
self.c.UserConfig.Git.Log.Order = value
|
||||
return self.c.WithWaitingStatus(self.c.Tr.LcLoadingCommits, func() error {
|
||||
return self.c.Refresh(types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.COMMITS}})
|
||||
return self.c.Refresh(
|
||||
types.RefreshOptions{
|
||||
Mode: types.SYNC,
|
||||
Scope: []types.RefreshableView{types.COMMITS},
|
||||
},
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,11 @@ func (self *RemotesController) enter(remote *models.Remote) error {
|
||||
newSelectedLine = -1
|
||||
}
|
||||
self.contexts.RemoteBranches.SetSelectedLineIdx(newSelectedLine)
|
||||
self.contexts.RemoteBranches.SetTitleRef(remote.Name)
|
||||
|
||||
if err := self.c.PostRefreshUpdate(self.contexts.RemoteBranches); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return self.c.PushContext(self.contexts.RemoteBranches)
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ type CanSwitchToDiffFiles interface {
|
||||
types.Context
|
||||
CanRebase() bool
|
||||
GetSelectedRefName() string
|
||||
GetSelectedDescription() string
|
||||
}
|
||||
|
||||
type SwitchToDiffFilesController struct {
|
||||
@ -63,9 +64,10 @@ func (self *SwitchToDiffFilesController) checkSelected(callback func(string) err
|
||||
|
||||
func (self *SwitchToDiffFilesController) enter(refName string) error {
|
||||
return self.viewFiles(SwitchToCommitFilesContextOpts{
|
||||
RefName: refName,
|
||||
CanRebase: self.context.CanRebase(),
|
||||
Context: self.context,
|
||||
RefName: refName,
|
||||
RefDescription: self.context.GetSelectedDescription(),
|
||||
CanRebase: self.context.CanRebase(),
|
||||
Context: self.context,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ var _ types.IController = &SwitchToSubCommitsController{}
|
||||
type CanSwitchToSubCommits interface {
|
||||
types.Context
|
||||
GetSelectedRefName() string
|
||||
GetSelectedDescription() string
|
||||
}
|
||||
|
||||
type SwitchToSubCommitsController struct {
|
||||
@ -74,6 +75,7 @@ func (self *SwitchToSubCommitsController) viewCommits() error {
|
||||
self.contexts.SubCommits.SetSelectedLineIdx(0)
|
||||
self.contexts.SubCommits.SetParentContext(self.context)
|
||||
self.contexts.SubCommits.SetWindowName(self.context.GetWindowName())
|
||||
self.contexts.SubCommits.SetTitleRef(self.context.GetSelectedDescription())
|
||||
self.contexts.SubCommits.SetRefName(refName)
|
||||
|
||||
err = self.c.PostRefreshUpdate(self.contexts.SubCommits)
|
||||
|
@ -6,7 +6,17 @@ import (
|
||||
|
||||
// all fields mandatory (except `CanRebase` because it's boolean)
|
||||
type SwitchToCommitFilesContextOpts struct {
|
||||
RefName string
|
||||
// this is something like a commit sha or branch name
|
||||
RefName string
|
||||
|
||||
// this will be displayed in the title of the view so we know whose diff files
|
||||
// we're viewing
|
||||
RefDescription string
|
||||
|
||||
// from the local commits view we're allowed to do rebase stuff with any patch
|
||||
// we generate from the diff files context, but we don't have that same ability
|
||||
// with say the sub commits context or the reflog context.
|
||||
CanRebase bool
|
||||
Context types.Context
|
||||
|
||||
Context types.Context
|
||||
}
|
||||
|
Reference in New Issue
Block a user