mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-10 22:42:00 +02:00
fix format issue
This commit is contained in:
@@ -28,8 +28,9 @@ func (gui *Gui) refreshStatus() {
|
|||||||
status += presentation.ColoredBranchStatus(currentBranch) + " "
|
status += presentation.ColoredBranchStatus(currentBranch) + " "
|
||||||
}
|
}
|
||||||
|
|
||||||
if gui.Git.Status.WorkingTreeState() != enums.REBASE_MODE_NONE {
|
workingTreeState := gui.Git.Status.WorkingTreeState()
|
||||||
status += style.FgYellow.Sprintf("(%s) ", gui.Git.Status.WorkingTreeState())
|
if workingTreeState != enums.REBASE_MODE_NONE {
|
||||||
|
status += style.FgYellow.Sprintf("(%s) ", formatWorkingTreeState(workingTreeState))
|
||||||
}
|
}
|
||||||
|
|
||||||
name := presentation.GetBranchTextStyle(currentBranch.Name).Sprint(currentBranch.Name)
|
name := presentation.GetBranchTextStyle(currentBranch.Name).Sprint(currentBranch.Name)
|
||||||
@@ -74,13 +75,7 @@ func (gui *Gui) handleStatusClick() error {
|
|||||||
workingTreeState := gui.Git.Status.WorkingTreeState()
|
workingTreeState := gui.Git.Status.WorkingTreeState()
|
||||||
switch workingTreeState {
|
switch workingTreeState {
|
||||||
case enums.REBASE_MODE_REBASING, enums.REBASE_MODE_MERGING:
|
case enums.REBASE_MODE_REBASING, enums.REBASE_MODE_MERGING:
|
||||||
var formattedState string
|
workingTreeStatus := fmt.Sprintf("(%s)", formatWorkingTreeState(workingTreeState))
|
||||||
if workingTreeState == enums.REBASE_MODE_REBASING {
|
|
||||||
formattedState = "rebasing"
|
|
||||||
} else {
|
|
||||||
formattedState = "merging"
|
|
||||||
}
|
|
||||||
workingTreeStatus := fmt.Sprintf("(%s)", formattedState)
|
|
||||||
if cursorInSubstring(cx, upstreamStatus+" ", workingTreeStatus) {
|
if cursorInSubstring(cx, upstreamStatus+" ", workingTreeStatus) {
|
||||||
return gui.handleCreateRebaseOptionsMenu()
|
return gui.handleCreateRebaseOptionsMenu()
|
||||||
}
|
}
|
||||||
@@ -96,6 +91,17 @@ func (gui *Gui) handleStatusClick() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func formatWorkingTreeState(rebaseMode enums.RebaseMode) string {
|
||||||
|
switch rebaseMode {
|
||||||
|
case enums.REBASE_MODE_REBASING:
|
||||||
|
return "rebasing"
|
||||||
|
case enums.REBASE_MODE_MERGING:
|
||||||
|
return "merging"
|
||||||
|
default:
|
||||||
|
return "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (gui *Gui) statusRenderToMain() error {
|
func (gui *Gui) statusRenderToMain() error {
|
||||||
// TODO: move into some abstraction (status is currently not a listViewContext where a lot of this code lives)
|
// TODO: move into some abstraction (status is currently not a listViewContext where a lot of this code lives)
|
||||||
if gui.popupPanelFocused() {
|
if gui.popupPanelFocused() {
|
||||||
|
Reference in New Issue
Block a user