1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

add remote branches controller

This commit is contained in:
Jesse Duffield
2022-02-26 19:06:22 +11:00
parent d543e767d4
commit ee1337b931
5 changed files with 194 additions and 219 deletions

View File

@ -387,21 +387,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleCopySelectedSideContextItemToClipboard,
Description: self.c.Tr.LcCopyBranchNameToClipboard,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.handleRemoteBranchesEscape,
Description: self.c.Tr.ReturnToRemotesList,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.handleCreateResetToRemoteBranchMenu,
Description: self.c.Tr.LcViewResetOptions,
OpensMenu: true,
},
{
ViewName: "commits",
Contexts: []string{string(context.LOCAL_COMMITS_CONTEXT_KEY)},
@ -872,49 +857,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleMergeConflictUndo,
Description: self.c.Tr.LcUndo,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Universal.Select),
// gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch
Handler: self.handleNewBranchOffRemoteBranch,
Description: self.c.Tr.LcCheckout,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Universal.New),
Handler: self.handleNewBranchOffRemoteBranch,
Description: self.c.Tr.LcNewBranch,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Branches.MergeIntoCurrentBranch),
Handler: opts.Guards.OutsideFilterMode(self.handleMergeRemoteBranch),
Description: self.c.Tr.LcMergeIntoCurrentBranch,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.handleDeleteRemoteBranch,
Description: self.c.Tr.LcDeleteBranch,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Branches.RebaseBranch),
Handler: opts.Guards.OutsideFilterMode(self.handleRebaseOntoRemoteBranch),
Description: self.c.Tr.LcRebaseBranch,
},
{
ViewName: "branches",
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
Key: opts.GetKey(opts.Config.Branches.SetUpstream),
Handler: self.handleSetBranchUpstream,
Description: self.c.Tr.LcSetUpstream,
},
{
ViewName: "status",
Key: gocui.MouseLeft,