1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-08 23:56:15 +02:00

Add a menu item and keybinding to } to increase the context size

This commit is contained in:
DerTeta 2021-09-11 20:42:23 +02:00 committed by Jesse Duffield
parent ba844c18a5
commit 0fbde05928
4 changed files with 11 additions and 0 deletions

View File

@ -154,6 +154,7 @@ keybinding:
appendNewline: '<a-enter>' appendNewline: '<a-enter>'
extrasMenu: '@' extrasMenu: '@'
toggleWhitespaceInDiffView: '<c-w>' toggleWhitespaceInDiffView: '<c-w>'
increaseContextInDiffView: '}'
status: status:
checkForUpdate: 'u' checkForUpdate: 'u'
recentRepos: '<enter>' recentRepos: '<enter>'

View File

@ -177,6 +177,7 @@ type KeybindingUniversalConfig struct {
AppendNewline string `yaml:"appendNewline"` AppendNewline string `yaml:"appendNewline"`
ExtrasMenu string `yaml:"extrasMenu"` ExtrasMenu string `yaml:"extrasMenu"`
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"` ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
IncreaseContextInDiffView string `yaml:"increaseContextInDiffView"`
} }
type KeybindingStatusConfig struct { type KeybindingStatusConfig struct {
@ -438,6 +439,7 @@ func GetDefaultConfig() *UserConfig {
AppendNewline: "<a-enter>", AppendNewline: "<a-enter>",
ExtrasMenu: "@", ExtrasMenu: "@",
ToggleWhitespaceInDiffView: "<c-w>", ToggleWhitespaceInDiffView: "<c-w>",
IncreaseContextInDiffView: "}",
}, },
Status: KeybindingStatusConfig{ Status: KeybindingStatusConfig{
CheckForUpdate: "u", CheckForUpdate: "u",

View File

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

View File

@ -427,6 +427,7 @@ type TranslationSet struct {
ToggleWhitespaceInDiffView string ToggleWhitespaceInDiffView string
IgnoringWhitespaceInDiffView string IgnoringWhitespaceInDiffView string
ShowingWhitespaceInDiffView string ShowingWhitespaceInDiffView string
IncreaseContextInDiffView string
CreatePullRequestOptions string CreatePullRequestOptions string
LcCreatePullRequestOptions string LcCreatePullRequestOptions string
LcDefaultBranch string LcDefaultBranch string
@ -967,6 +968,7 @@ func englishTranslationSet() TranslationSet {
ToggleWhitespaceInDiffView: "Toggle whether or not whitespace changes are shown in the diff view", ToggleWhitespaceInDiffView: "Toggle whether or not whitespace changes are shown in the diff view",
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",
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",