mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Remove ColoredBranchStatus and branchStatusColor
Previously the entire status was colored in a single color, so the API made sense. This is going to change in the next commit, so now we must include the color in the string returned from BranchStatus(), which means that callers who need to do hit detection or measure the length need to decolorize it. While we're at it, switch the order of ↑3↓7 to ↓7↑3. For some reason that I can't really explain I find it more logical this way. The software out there is pretty undecided about it, it seems: VS Code puts ↓7 first, and so does the shell prompt that comes with git; git status and git branch -v put "ahead" first though. Shrug.
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
@ -116,7 +117,7 @@ func (self *StatusController) onClick(opts gocui.ViewMouseBindingOpts) error {
|
||||
return err
|
||||
}
|
||||
|
||||
upstreamStatus := presentation.BranchStatus(currentBranch, types.ItemOperationNone, self.c.Tr, time.Now(), self.c.UserConfig)
|
||||
upstreamStatus := utils.Decolorise(presentation.BranchStatus(currentBranch, types.ItemOperationNone, self.c.Tr, time.Now(), self.c.UserConfig))
|
||||
repoName := self.c.Git().RepoPaths.RepoName()
|
||||
workingTreeState := self.c.Git().Status.WorkingTreeState()
|
||||
switch workingTreeState {
|
||||
|
Reference in New Issue
Block a user