mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Merge 2b22ad1651
into ef1da6f704
This commit is contained in:
commit
77066cdcbe
5 changed files with 35 additions and 5 deletions
|
@ -516,6 +516,7 @@ keybinding:
|
||||||
goInto: <enter>
|
goInto: <enter>
|
||||||
confirm: <enter>
|
confirm: <enter>
|
||||||
confirmInEditor: <a-enter>
|
confirmInEditor: <a-enter>
|
||||||
|
confirmInEditor-alt: <c-s>
|
||||||
remove: d
|
remove: d
|
||||||
new: "n"
|
new: "n"
|
||||||
edit: e
|
edit: e
|
||||||
|
|
|
@ -405,6 +405,7 @@ type KeybindingUniversalConfig struct {
|
||||||
GoInto string `yaml:"goInto"`
|
GoInto string `yaml:"goInto"`
|
||||||
Confirm string `yaml:"confirm"`
|
Confirm string `yaml:"confirm"`
|
||||||
ConfirmInEditor string `yaml:"confirmInEditor"`
|
ConfirmInEditor string `yaml:"confirmInEditor"`
|
||||||
|
ConfirmInEditorAlt string `yaml:"confirmInEditor-alt"`
|
||||||
Remove string `yaml:"remove"`
|
Remove string `yaml:"remove"`
|
||||||
New string `yaml:"new"`
|
New string `yaml:"new"`
|
||||||
Edit string `yaml:"edit"`
|
Edit string `yaml:"edit"`
|
||||||
|
@ -882,6 +883,7 @@ func GetDefaultConfig() *UserConfig {
|
||||||
GoInto: "<enter>",
|
GoInto: "<enter>",
|
||||||
Confirm: "<enter>",
|
Confirm: "<enter>",
|
||||||
ConfirmInEditor: "<a-enter>",
|
ConfirmInEditor: "<a-enter>",
|
||||||
|
ConfirmInEditorAlt: "<c-s>",
|
||||||
Remove: "d",
|
Remove: "d",
|
||||||
New: "n",
|
New: "n",
|
||||||
Edit: "e",
|
Edit: "e",
|
||||||
|
|
|
@ -38,6 +38,10 @@ func (self *CommitDescriptionController) GetKeybindings(opts types.KeybindingsOp
|
||||||
Key: opts.GetKey(opts.Config.Universal.ConfirmInEditor),
|
Key: opts.GetKey(opts.Config.Universal.ConfirmInEditor),
|
||||||
Handler: self.confirm,
|
Handler: self.confirm,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.ConfirmInEditorAlt),
|
||||||
|
Handler: self.confirm,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Key: opts.GetKey(opts.Config.CommitMessage.CommitMenu),
|
Key: opts.GetKey(opts.Config.CommitMessage.CommitMenu),
|
||||||
Handler: self.openCommitMenu,
|
Handler: self.openCommitMenu,
|
||||||
|
@ -63,10 +67,27 @@ func (self *CommitDescriptionController) GetMouseKeybindings(opts types.Keybindi
|
||||||
|
|
||||||
func (self *CommitDescriptionController) GetOnFocus() func(types.OnFocusOpts) {
|
func (self *CommitDescriptionController) GetOnFocus() func(types.OnFocusOpts) {
|
||||||
return func(types.OnFocusOpts) {
|
return func(types.OnFocusOpts) {
|
||||||
self.c.Views().CommitDescription.Footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter,
|
footer := ""
|
||||||
map[string]string{
|
if self.c.UserConfig().Keybinding.Universal.ConfirmInEditor != "<disabled>" || self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt != "<disabled>" {
|
||||||
"confirmInEditorKeybinding": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditor),
|
if self.c.UserConfig().Keybinding.Universal.ConfirmInEditor == "<disabled>" {
|
||||||
})
|
footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter,
|
||||||
|
map[string]string{
|
||||||
|
"confirmInEditorKeybinding": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt),
|
||||||
|
})
|
||||||
|
} else if self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt == "<disabled>" {
|
||||||
|
footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter,
|
||||||
|
map[string]string{
|
||||||
|
"confirmInEditorKeybinding": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditor),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooterTwoBindings,
|
||||||
|
map[string]string{
|
||||||
|
"confirmInEditorKeybinding1": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditor),
|
||||||
|
"confirmInEditorKeybinding2": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.c.Views().CommitDescription.Footer = footer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,7 @@ type TranslationSet struct {
|
||||||
CommitDescriptionTitle string
|
CommitDescriptionTitle string
|
||||||
CommitDescriptionSubTitle string
|
CommitDescriptionSubTitle string
|
||||||
CommitDescriptionFooter string
|
CommitDescriptionFooter string
|
||||||
|
CommitDescriptionFooterTwoBindings string
|
||||||
CommitHooksDisabledSubTitle string
|
CommitHooksDisabledSubTitle string
|
||||||
LocalBranchesTitle string
|
LocalBranchesTitle string
|
||||||
SearchTitle string
|
SearchTitle string
|
||||||
|
@ -1408,7 +1409,8 @@ func EnglishTranslationSet() *TranslationSet {
|
||||||
CommitSummaryTitle: "Commit summary",
|
CommitSummaryTitle: "Commit summary",
|
||||||
CommitDescriptionTitle: "Commit description",
|
CommitDescriptionTitle: "Commit description",
|
||||||
CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
|
CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
|
||||||
CommitDescriptionFooter: "Press {{.confirmInEditorKeybinding}} to commit",
|
CommitDescriptionFooter: "Press {{.confirmInEditorKeybinding}} to submit",
|
||||||
|
CommitDescriptionFooterTwoBindings: "Press {{.confirmInEditorKeybinding1}} or {{.confirmInEditorKeybinding2}} to submit",
|
||||||
CommitHooksDisabledSubTitle: "(hooks disabled)",
|
CommitHooksDisabledSubTitle: "(hooks disabled)",
|
||||||
LocalBranchesTitle: "Local branches",
|
LocalBranchesTitle: "Local branches",
|
||||||
SearchTitle: "Search",
|
SearchTitle: "Search",
|
||||||
|
|
|
@ -1310,6 +1310,10 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "\u003ca-enter\u003e"
|
"default": "\u003ca-enter\u003e"
|
||||||
},
|
},
|
||||||
|
"confirmInEditor-alt": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "\u003cc-s\u003e"
|
||||||
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "d"
|
"default": "d"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue