mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
small refactor
This commit is contained in:
parent
b0241c79db
commit
d1ccf11502
2 changed files with 6 additions and 3 deletions
|
|
@ -69,8 +69,7 @@ type IGui interface {
|
|||
FocusY(selectedLine int, itemCount int, view *gocui.View)
|
||||
ShouldRefresh(contextKey string) bool
|
||||
GetMainView() *gocui.View
|
||||
// TODO: replace with IsCurrentView() bool
|
||||
CurrentView() *gocui.View
|
||||
IsCurrentView(*gocui.View) bool
|
||||
FilterString(view *gocui.View) string
|
||||
IgnoreStrings() []string
|
||||
Update(func() error)
|
||||
|
|
@ -242,7 +241,7 @@ func (self *SideListPanel[T]) RerenderList() error {
|
|||
}
|
||||
}
|
||||
|
||||
if self.View == self.Gui.CurrentView() {
|
||||
if self.Gui.IsCurrentView(self.View) {
|
||||
return self.HandleSelect()
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -368,3 +368,7 @@ func (gui *Gui) allSidePanels() []panels.ISideListPanel {
|
|||
func (gui *Gui) allListPanels() []panels.ISideListPanel {
|
||||
return append(gui.allSidePanels(), gui.Panels.Menu)
|
||||
}
|
||||
|
||||
func (gui *Gui) IsCurrentView(view *gocui.View) bool {
|
||||
return view == gui.CurrentView()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue