summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerTeta <derteta@gmx.de>2021-09-11 20:42:23 +0200
committerJesse Duffield <jessedduffield@gmail.com>2021-12-06 22:37:28 +1100
commit0fbde0592830cf5fdaf961f481d073164a1679e8 (patch)
treec1cf215ff458006943908d9e2719ba14f5d15a5e
parentba844c18a5cad4a268ef0ebf03b2b85f6bfe0b92 (diff)
Add a menu item and keybinding to `}` to increase the context size
-rw-r--r--docs/Config.md1
-rw-r--r--pkg/config/user_config.go2
-rw-r--r--pkg/gui/keybindings.go6
-rw-r--r--pkg/i18n/english.go2
4 files changed, 11 insertions, 0 deletions
diff --git a/docs/Config.md b/docs/Config.md
index 020b4724a..b2cb562c0 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -154,6 +154,7 @@ keybinding:
appendNewline: '<a-enter>'
extrasMenu: '@'
toggleWhitespaceInDiffView: '<c-w>'
+ increaseContextInDiffView: '}'
status:
checkForUpdate: 'u'
recentRepos: '<enter>'
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 09895f66d..5f747f85c 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -177,6 +177,7 @@ type KeybindingUniversalConfig struct {
AppendNewline string `yaml:"appendNewline"`
ExtrasMenu string `yaml:"extrasMenu"`
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
+ IncreaseContextInDiffView string `yaml:"increaseContextInDiffView"`
}
type KeybindingStatusConfig struct {
@@ -438,6 +439,7 @@ func GetDefaultConfig() *UserConfig {
AppendNewline: "<a-enter>",
ExtrasMenu: "@",
ToggleWhitespaceInDiffView: "<c-w>",
+ IncreaseContextInDiffView: "}",
},
Status: KeybindingStatusConfig{
CheckForUpdate: "u",
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 232708b9b..65bd5df42 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -1771,6 +1771,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Description: gui.Tr.ToggleWhitespaceInDiffView,
},
{
+ ViewName: "",
+ Key: gui.getKey(config.Universal.IncreaseContextInDiffView),
+ Handler: gui.IncreaseContextInDiffView,
+ Description: gui.Tr.IncreaseContextInDiffView,
+ },
+ {
ViewName: "extras",
Key: gocui.MouseWheelUp,
Handler: gui.scrollUpExtra,
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index da218ac74..eacec4e21 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -427,6 +427,7 @@ type TranslationSet struct {
ToggleWhitespaceInDiffView string
IgnoringWhitespaceInDiffView string
ShowingWhitespaceInDiffView string
+ IncreaseContextInDiffView string
CreatePullRequestOptions string
LcCreatePullRequestOptions string
LcDefaultBranch string
@@ -967,6 +968,7 @@ func englishTranslationSet() TranslationSet {
ToggleWhitespaceInDiffView: "Toggle whether or not whitespace changes are shown in the diff view",
IgnoringWhitespaceInDiffView: "Whitespace will be ignored in the diff view",
ShowingWhitespaceInDiffView: "Whitespace will be shown in the diff view",
+ IncreaseContextInDiffView: "Increase the size of the context shown around changes in the diff view",
CreatePullRequest: "Create pull request",
CreatePullRequestOptions: "Create pull request options",
LcCreatePullRequestOptions: "create pull request options",