diff options
author | DerTeta <derteta@gmx.de> | 2021-09-11 20:42:23 +0200 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-06 22:37:28 +1100 |
commit | 0fbde0592830cf5fdaf961f481d073164a1679e8 (patch) | |
tree | c1cf215ff458006943908d9e2719ba14f5d15a5e /pkg | |
parent | ba844c18a5cad4a268ef0ebf03b2b85f6bfe0b92 (diff) |
Add a menu item and keybinding to `}` to increase the context size
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/config/user_config.go | 2 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 6 | ||||
-rw-r--r-- | pkg/i18n/english.go | 2 |
3 files changed, 10 insertions, 0 deletions
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", |