mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-08 22:52:12 +02:00
Show "Log (x of y)" in the title bar when there is more than one branch log command
This commit is contained in:
@@ -292,6 +292,12 @@ func (self *BranchCommands) RotateAllBranchesLogIdx() {
|
|||||||
self.allBranchesLogCmdIndex = (i + 1) % n
|
self.allBranchesLogCmdIndex = (i + 1) % n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *BranchCommands) GetAllBranchesLogIdxAndCount() (int, int) {
|
||||||
|
n := len(self.allBranchesLogCandidates())
|
||||||
|
i := self.allBranchesLogCmdIndex
|
||||||
|
return i, n
|
||||||
|
}
|
||||||
|
|
||||||
func (self *BranchCommands) IsBranchMerged(branch *models.Branch, mainBranches *MainBranches) (bool, error) {
|
func (self *BranchCommands) IsBranchMerged(branch *models.Branch, mainBranches *MainBranches) (bool, error) {
|
||||||
branchesToCheckAgainst := []string{"HEAD"}
|
branchesToCheckAgainst := []string{"HEAD"}
|
||||||
if branch.RemoteBranchStoredLocally() {
|
if branch.RemoteBranchStoredLocally() {
|
||||||
|
@@ -181,10 +181,14 @@ func (self *StatusController) showAllBranchLogs() {
|
|||||||
cmdObj := self.c.Git().Branch.AllBranchesLogCmdObj()
|
cmdObj := self.c.Git().Branch.AllBranchesLogCmdObj()
|
||||||
task := types.NewRunPtyTask(cmdObj.GetCmd())
|
task := types.NewRunPtyTask(cmdObj.GetCmd())
|
||||||
|
|
||||||
|
title := self.c.Tr.LogTitle
|
||||||
|
if i, n := self.c.Git().Branch.GetAllBranchesLogIdxAndCount(); n > 1 {
|
||||||
|
title = fmt.Sprintf(self.c.Tr.LogXOfYTitle, i+1, n)
|
||||||
|
}
|
||||||
self.c.RenderToMainViews(types.RefreshMainOpts{
|
self.c.RenderToMainViews(types.RefreshMainOpts{
|
||||||
Pair: self.c.MainViewPairs().Normal,
|
Pair: self.c.MainViewPairs().Normal,
|
||||||
Main: &types.ViewUpdateOpts{
|
Main: &types.ViewUpdateOpts{
|
||||||
Title: self.c.Tr.LogTitle,
|
Title: title,
|
||||||
Task: task,
|
Task: task,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@@ -30,6 +30,7 @@ type TranslationSet struct {
|
|||||||
RegularMergeTooltip string
|
RegularMergeTooltip string
|
||||||
NormalTitle string
|
NormalTitle string
|
||||||
LogTitle string
|
LogTitle string
|
||||||
|
LogXOfYTitle string
|
||||||
CommitSummary string
|
CommitSummary string
|
||||||
CredentialsUsername string
|
CredentialsUsername string
|
||||||
CredentialsPassword string
|
CredentialsPassword string
|
||||||
@@ -1104,6 +1105,7 @@ func EnglishTranslationSet() *TranslationSet {
|
|||||||
MergingTitle: "Main panel (merging)",
|
MergingTitle: "Main panel (merging)",
|
||||||
NormalTitle: "Main panel (normal)",
|
NormalTitle: "Main panel (normal)",
|
||||||
LogTitle: "Log",
|
LogTitle: "Log",
|
||||||
|
LogXOfYTitle: "Log (%d of %d)",
|
||||||
CommitSummary: "Commit summary",
|
CommitSummary: "Commit summary",
|
||||||
CredentialsUsername: "Username",
|
CredentialsUsername: "Username",
|
||||||
CredentialsPassword: "Password",
|
CredentialsPassword: "Password",
|
||||||
|
Reference in New Issue
Block a user