mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
Make WorkingTreeState a struct, and add cherry-picking and reverting states
This commit is contained in:
@ -7,7 +7,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/constants"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
@ -109,8 +108,7 @@ func (self *StatusController) onClick(opts gocui.ViewMouseBindingOpts) error {
|
||||
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 {
|
||||
case models.WORKING_TREE_STATE_REBASING, models.WORKING_TREE_STATE_MERGING:
|
||||
if workingTreeState.Any() {
|
||||
workingTreeStatus := fmt.Sprintf("(%s)", workingTreeState.LowerCaseTitle(self.c.Tr))
|
||||
if cursorInSubstring(opts.X, upstreamStatus+" ", workingTreeStatus) {
|
||||
return self.c.Helpers().MergeAndRebase.CreateRebaseOptionsMenu()
|
||||
@ -118,10 +116,8 @@ func (self *StatusController) onClick(opts gocui.ViewMouseBindingOpts) error {
|
||||
if cursorInSubstring(opts.X, upstreamStatus+" "+workingTreeStatus+" ", repoName) {
|
||||
return self.c.Helpers().Repos.CreateRecentReposMenu()
|
||||
}
|
||||
default:
|
||||
if cursorInSubstring(opts.X, upstreamStatus+" ", repoName) {
|
||||
return self.c.Helpers().Repos.CreateRecentReposMenu()
|
||||
}
|
||||
} else if cursorInSubstring(opts.X, upstreamStatus+" ", repoName) {
|
||||
return self.c.Helpers().Repos.CreateRecentReposMenu()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user