1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-17 22:32:58 +02:00

Add a menu entry and keybinding to { for decreasing the context size

This commit is contained in:
DerTeta 2021-09-11 19:35:17 +02:00 committed by Jesse Duffield
parent 0fbde05928
commit f7ffbbd72a
4 changed files with 11 additions and 0 deletions

View File

@ -155,6 +155,7 @@ keybinding:
extrasMenu: '@' extrasMenu: '@'
toggleWhitespaceInDiffView: '<c-w>' toggleWhitespaceInDiffView: '<c-w>'
increaseContextInDiffView: '}' increaseContextInDiffView: '}'
decreaseContextInDiffView: '{'
status: status:
checkForUpdate: 'u' checkForUpdate: 'u'
recentRepos: '<enter>' recentRepos: '<enter>'

View File

@ -178,6 +178,7 @@ type KeybindingUniversalConfig struct {
ExtrasMenu string `yaml:"extrasMenu"` ExtrasMenu string `yaml:"extrasMenu"`
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"` ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
IncreaseContextInDiffView string `yaml:"increaseContextInDiffView"` IncreaseContextInDiffView string `yaml:"increaseContextInDiffView"`
DecreaseContextInDiffView string `yaml:"decreaseContextInDiffView"`
} }
type KeybindingStatusConfig struct { type KeybindingStatusConfig struct {
@ -440,6 +441,7 @@ func GetDefaultConfig() *UserConfig {
ExtrasMenu: "@", ExtrasMenu: "@",
ToggleWhitespaceInDiffView: "<c-w>", ToggleWhitespaceInDiffView: "<c-w>",
IncreaseContextInDiffView: "}", IncreaseContextInDiffView: "}",
DecreaseContextInDiffView: "{",
}, },
Status: KeybindingStatusConfig{ Status: KeybindingStatusConfig{
CheckForUpdate: "u", CheckForUpdate: "u",

View File

@ -1776,6 +1776,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.IncreaseContextInDiffView, Handler: gui.IncreaseContextInDiffView,
Description: gui.Tr.IncreaseContextInDiffView, Description: gui.Tr.IncreaseContextInDiffView,
}, },
{
ViewName: "",
Key: gui.getKey(config.Universal.DecreaseContextInDiffView),
Handler: gui.DecreaseContextInDiffView,
Description: gui.Tr.DecreaseContextInDiffView,
},
{ {
ViewName: "extras", ViewName: "extras",
Key: gocui.MouseWheelUp, Key: gocui.MouseWheelUp,

View File

@ -428,6 +428,7 @@ type TranslationSet struct {
IgnoringWhitespaceInDiffView string IgnoringWhitespaceInDiffView string
ShowingWhitespaceInDiffView string ShowingWhitespaceInDiffView string
IncreaseContextInDiffView string IncreaseContextInDiffView string
DecreaseContextInDiffView string
CreatePullRequestOptions string CreatePullRequestOptions string
LcCreatePullRequestOptions string LcCreatePullRequestOptions string
LcDefaultBranch string LcDefaultBranch string
@ -969,6 +970,7 @@ func englishTranslationSet() TranslationSet {
IgnoringWhitespaceInDiffView: "Whitespace will be ignored in the diff view", IgnoringWhitespaceInDiffView: "Whitespace will be ignored in the diff view",
ShowingWhitespaceInDiffView: "Whitespace will be shown 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", IncreaseContextInDiffView: "Increase the size of the context shown around changes in the diff view",
DecreaseContextInDiffView: "Decrease the size of the context shown around changes in the diff view",
CreatePullRequest: "Create pull request", CreatePullRequest: "Create pull request",
CreatePullRequestOptions: "Create pull request options", CreatePullRequestOptions: "Create pull request options",
LcCreatePullRequestOptions: "create pull request options", LcCreatePullRequestOptions: "create pull request options",