mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
add submodules context
This commit is contained in:
@ -363,102 +363,119 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChanges"),
|
||||
Handler: gui.wrappedHandler(gui.handleCommitPress),
|
||||
Description: gui.Tr.SLocalize("CommitChanges"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChangesWithoutHook"),
|
||||
Handler: gui.handleWIPCommitPress,
|
||||
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.amendLastCommit"),
|
||||
Handler: gui.wrappedHandler(gui.handleAmendCommitPress),
|
||||
Description: gui.Tr.SLocalize("AmendLastCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChangesWithEditor"),
|
||||
Handler: gui.wrappedHandler(gui.handleCommitEditorPress),
|
||||
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.wrappedHandler(gui.handleFilePress),
|
||||
Description: gui.Tr.SLocalize("toggleStaged"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleCreateDiscardMenu,
|
||||
Description: gui.Tr.SLocalize("viewDiscardOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Handler: gui.handleFileEdit,
|
||||
Description: gui.Tr.SLocalize("editFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Handler: gui.handleFileOpen,
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.ignoreFile"),
|
||||
Handler: gui.handleIgnoreFile,
|
||||
Description: gui.Tr.SLocalize("ignoreFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.refreshFiles"),
|
||||
Handler: gui.handleRefreshFiles,
|
||||
Description: gui.Tr.SLocalize("refreshFiles"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.stashAllChanges"),
|
||||
Handler: gui.handleStashChanges,
|
||||
Description: gui.Tr.SLocalize("stashAllChanges"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.viewStashOptions"),
|
||||
Handler: gui.handleCreateStashMenu,
|
||||
Description: gui.Tr.SLocalize("viewStashOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.toggleStagedAll"),
|
||||
Handler: gui.handleStageAll,
|
||||
Description: gui.Tr.SLocalize("toggleStagedAll"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.viewResetOptions"),
|
||||
Handler: gui.handleCreateResetMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Handler: gui.handleEnterFile,
|
||||
Description: gui.Tr.SLocalize("StageLines"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.fetch"),
|
||||
Handler: gui.handleGitFetch,
|
||||
Description: gui.Tr.SLocalize("fetch"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copyFileNameToClipboard"),
|
||||
@ -471,6 +488,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{FILES_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateResetToUpstreamMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetToUpstreamOptions"),
|
||||
@ -1542,6 +1560,32 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.wrappedHandler(gui.onMenuPress),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{SUBMODULES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Handler: gui.wrappedHandler(gui.handleSubmoduleEnter),
|
||||
Description: gui.Tr.SLocalize("enterSubmodule"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Handler: gui.handleNextTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Handler: gui.handlePrevTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{SUBMODULES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copySubmoduleNameToClipboard"),
|
||||
},
|
||||
}
|
||||
|
||||
for _, viewName := range []string{"status", "branches", "files", "commits", "commitFiles", "stash", "menu"} {
|
||||
|
Reference in New Issue
Block a user