diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-21 21:17:09 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 41df63cdc4d799ce7d78ecb0b1ed96dea65f1739 (patch) | |
tree | f590c6ceba89d374a0d25d9fc1561c22a20b259f /pkg | |
parent | 4080e9b501137543ea4234be285b51fe9b29cf6b (diff) |
show when building patch
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/global_handlers.go | 19 | ||||
-rw-r--r-- | pkg/gui/layout.go | 2 | ||||
-rw-r--r-- | pkg/i18n/english.go | 3 |
3 files changed, 13 insertions, 11 deletions
diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index 41c4895ff..ee44a3c48 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -142,21 +142,18 @@ func (gui *Gui) handleInfoClick(g *gocui.Gui, v *gocui.View) error { width, _ := v.Size() // if we're in the normal context there will be a donate button here - // if we have ('reset') at the end then - if gui.inFilterMode() { - if width-cx <= len(gui.Tr.SLocalize("(reset)")) { + if width-cx <= len(gui.Tr.SLocalize("(reset)")) { + if gui.inFilterMode() { return gui.exitFilterMode() - } else { - return nil } - } - - if gui.inDiffMode() { - if width-cx <= len(gui.Tr.SLocalize("(reset)")) { + if gui.inDiffMode() { return gui.exitDiffMode() - } else { - return nil } + if gui.GitCommand.PatchManager.Active() { + return gui.handleResetPatch() + } + } else { + return nil } if cx <= len(gui.Tr.SLocalize("Donate"))+len(INFO_SECTION_PADDING) { diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index 266bb278c..cebda6375 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -17,6 +17,8 @@ func (gui *Gui) informationStr() string { return utils.ColoredString(fmt.Sprintf("%s %s %s", gui.Tr.SLocalize("showingGitDiff"), "git diff "+gui.diffStr(), utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), color.FgMagenta) } else if gui.inFilterMode() { return utils.ColoredString(fmt.Sprintf("%s '%s' %s", gui.Tr.SLocalize("filteringBy"), gui.State.FilterPath, utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), color.FgRed, color.Bold) + } else if gui.GitCommand.PatchManager.Active() { + return utils.ColoredString(fmt.Sprintf("%s %s", gui.Tr.SLocalize("buildingPatch"), utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), color.FgYellow, color.Bold) } else if len(gui.State.CherryPickedCommits) > 0 { return utils.ColoredString(fmt.Sprintf("%d commits copied", len(gui.State.CherryPickedCommits)), color.FgCyan) } else if gui.g.Mouse { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 4df273a71..fb4356139 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -1170,6 +1170,9 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "viewStashFiles", Other: "view stash entry's files", + }, &i18n.Message{ + ID: "buildingPatch", + Other: "building patch", }, ) } |