mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
remove dead code
This commit is contained in:
parent
fe87114074
commit
102c33433b
@ -430,17 +430,15 @@ func (gui *Gui) setViewTabForContext(c types.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for tabIndex, tabContext := range tabContexts {
|
for tabIndex, tabContext := range tabContexts {
|
||||||
for _, context := range tabContext.Contexts {
|
if tabContext.Context.GetKey() == c.GetKey() {
|
||||||
if context.GetKey() == c.GetKey() {
|
// get the view, set the tab
|
||||||
// get the view, set the tab
|
v, err := gui.g.View(c.GetViewName())
|
||||||
v, err := gui.g.View(c.GetViewName())
|
if err != nil {
|
||||||
if err != nil {
|
gui.c.Log.Error(err)
|
||||||
gui.c.Log.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
v.TabIndex = tabIndex
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
v.TabIndex = tabIndex
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,44 +140,44 @@ func (self *ViewContextMap) Entries() map[string]types.Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TabContext struct {
|
type TabContext struct {
|
||||||
Tab string
|
Tab string
|
||||||
Contexts []types.Context
|
Context types.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tree ContextTree) InitialViewTabContextMap() map[string][]TabContext {
|
func (tree ContextTree) InitialViewTabContextMap() map[string][]TabContext {
|
||||||
return map[string][]TabContext{
|
return map[string][]TabContext{
|
||||||
"branches": {
|
"branches": {
|
||||||
{
|
{
|
||||||
Tab: "Local Branches",
|
Tab: "Local Branches",
|
||||||
Contexts: []types.Context{tree.Branches},
|
Context: tree.Branches,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Tab: "Remotes",
|
Tab: "Remotes",
|
||||||
Contexts: []types.Context{tree.Remotes},
|
Context: tree.Remotes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Tab: "Tags",
|
Tab: "Tags",
|
||||||
Contexts: []types.Context{tree.Tags},
|
Context: tree.Tags,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"commits": {
|
"commits": {
|
||||||
{
|
{
|
||||||
Tab: "Commits",
|
Tab: "Commits",
|
||||||
Contexts: []types.Context{tree.LocalCommits},
|
Context: tree.LocalCommits,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Tab: "Reflog",
|
Tab: "Reflog",
|
||||||
Contexts: []types.Context{tree.ReflogCommits},
|
Context: tree.ReflogCommits,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"files": {
|
"files": {
|
||||||
{
|
{
|
||||||
Tab: "Files",
|
Tab: "Files",
|
||||||
Contexts: []types.Context{tree.Files},
|
Context: tree.Files,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Tab: "Submodules",
|
Tab: "Submodules",
|
||||||
Contexts: []types.Context{tree.Submodules},
|
Context: tree.Submodules,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ func (gui *Gui) secondaryViewFocused() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) onViewTabClick(viewName string, tabIndex int) error {
|
func (gui *Gui) onViewTabClick(viewName string, tabIndex int) error {
|
||||||
context := gui.State.ViewTabContextMap[viewName][tabIndex].Contexts[0]
|
context := gui.State.ViewTabContextMap[viewName][tabIndex].Context
|
||||||
|
|
||||||
return gui.c.PushContext(context)
|
return gui.c.PushContext(context)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user