summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-12 21:24:01 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-14 22:22:47 +1100
commit7995d56a858fdeb399ed884a6983008aa2089cfb (patch)
tree3eee8bd6d332e262a61f7f025e6658a62a77c485
parent30aed94aa8451911fc1c5ba1e52ff28b180a8d31 (diff)
allow editing or opening a file while resolving merge conflicts
-rw-r--r--pkg/gui/files_panel.go2
-rw-r--r--pkg/gui/keybindings.go26
-rw-r--r--pkg/i18n/english.go3
3 files changed, 23 insertions, 8 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 56ca123b4..af021c132 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -66,6 +66,8 @@ func (gui *Gui) handleFileSelect(g *gocui.Gui, v *gocui.View, alreadySelected bo
}
if file.HasInlineMergeConflicts {
+ gui.getMainView().Title = gui.Tr.SLocalize("MergeConflictsTitle")
+ gui.State.SplitMainPanel = false
return gui.refreshMergePanel()
}
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 5f10965e9..c02176a4f 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -906,16 +906,14 @@ func (gui *Gui) GetContextMap() map[string][]*Binding {
Handler: gui.handleSelectPrevConflict,
Description: gui.Tr.SLocalize("PrevConflict"),
}, {
- ViewName: "main",
- Key: gocui.KeyArrowRight,
- Modifier: gocui.ModNone,
- Handler: gui.handleSelectNextConflict,
-
+ ViewName: "main",
+ Key: gocui.KeyArrowRight,
+ Modifier: gocui.ModNone,
+ Handler: gui.handleSelectNextConflict,
Description: gui.Tr.SLocalize("NextConflict"),
}, {
- ViewName: "main",
- Key: gocui.KeyArrowUp,
-
+ ViewName: "main",
+ Key: gocui.KeyArrowUp,
Modifier: gocui.ModNone,
Handler: gui.handleSelectTop,
Description: gui.Tr.SLocalize("SelectTop"),
@@ -961,6 +959,18 @@ func (gui *Gui) GetContextMap() map[string][]*Binding {
Modifier: gocui.ModNone,
Handler: gui.handlePopFileSnapshot,
Description: gui.Tr.SLocalize("Undo"),
+ }, {
+ ViewName: "main",
+ Key: 'e',
+ Modifier: gocui.ModNone,
+ Handler: gui.handleFileEdit,
+ Description: gui.Tr.SLocalize("editFile"),
+ }, {
+ ViewName: "main",
+ Key: 'o',
+ Modifier: gocui.ModNone,
+ Handler: gui.handleFileOpen,
+ Description: gui.Tr.SLocalize("openFile"),
},
},
}
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index b15f60bbb..ee53cc1b9 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -148,6 +148,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
ID: "resolveMergeConflicts",
Other: "resolve merge conflicts",
}, &i18n.Message{
+ ID: "MergeConflictsTitle",
+ Other: "Merge Conflicts",
+ }, &i18n.Message{
ID: "checkout",
Other: "checkout",
}, &i18n.Message{