1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Use static context

This commit is contained in:
Cristian Betivu
2021-06-15 19:58:43 +02:00
committed by Jesse Duffield
parent 23285eab40
commit 39c8577074
2 changed files with 4 additions and 13 deletions

View File

@ -394,15 +394,8 @@ func (gui *Gui) pageDelta(view *gocui.View) int {
}
func getTabbedView(gui *Gui) *gocui.View {
v := gui.g.CurrentView()
if v == nil {
return nil
}
// if the action is invoked via the Options menu,
// we need to execute it against the parent view
if v.Name() == "menu" {
v = v.ParentView
}
return v
// It safe assumption that only static contexts have tabs
context := gui.currentStaticContext()
view, _ := gui.g.View(context.GetViewName())
return view
}