From e8301be74df9de05b9aaf0a9d06cde86b3c883cd Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Sun, 24 Nov 2019 22:09:10 -0500 Subject: [PATCH] rm unused cursor methods --- runtime/ui/layout/manager.go | 16 ++++++++-------- runtime/ui/view/filter.go | 10 ---------- runtime/ui/view/status.go | 10 ---------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/runtime/ui/layout/manager.go b/runtime/ui/layout/manager.go index 2aeb57a..5ff09e4 100644 --- a/runtime/ui/layout/manager.go +++ b/runtime/ui/layout/manager.go @@ -24,7 +24,7 @@ func (lm *Manager) Add(element Layout, location Location) { lm.elements[location] = append(lm.elements[location], element) } -func (lm *Manager) layoutHeaders(g *gocui.Gui, area Area) (Area, error) { +func (lm *Manager) planAndLayoutHeaders(g *gocui.Gui, area Area) (Area, error) { // layout headers top down if elements, exists := lm.elements[LocationHeader]; exists { for _, element := range elements { @@ -87,7 +87,7 @@ func (lm *Manager) planFooters(g *gocui.Gui, area Area) (Area, []int) { return area, footerHeights } -func (lm *Manager) layoutColumns(g *gocui.Gui, area Area) (Area, error) { +func (lm *Manager) planAndLayoutColumns(g *gocui.Gui, area Area) (Area, error) { // layout columns left to right if elements, exists := lm.elements[LocationColumn]; exists { widths := make([]int, len(elements)) @@ -204,8 +204,8 @@ func (lm *Manager) Layout(g *gocui.Gui) error { // pass 1: plan and layout elements - // plan and layout all headers - area, err := lm.layoutHeaders(g, area) + // headers... + area, err := lm.planAndLayoutHeaders(g, area) if err != nil { return err } @@ -215,7 +215,7 @@ func (lm *Manager) Layout(g *gocui.Gui) error { } lm.lastHeaderArea = area - // plan all footers, don't layout until all columns have been layedout. This is necessary since we must layout from + // plan footers... don't layout until all columns have been layedout. This is necessary since we must layout from // top to bottom, but we need the real estate planned for the footers to determine the bottom of the columns. var footerArea = area area, footerHeights := lm.planFooters(g, area) @@ -225,8 +225,8 @@ func (lm *Manager) Layout(g *gocui.Gui) error { } lm.lastFooterArea = area - // plan and layout the main columns - area, err = lm.layoutColumns(g, area) + // columns... + area, err = lm.planAndLayoutColumns(g, area) if err != nil { return nil } @@ -236,7 +236,7 @@ func (lm *Manager) Layout(g *gocui.Gui) error { } lm.lastColumnArea = area - // layout the footers according to the original available area and planned heights + // footers... layout according to the original available area and planned heights err = lm.layoutFooters(g, footerArea, footerHeights) if err != nil { return nil diff --git a/runtime/ui/view/filter.go b/runtime/ui/view/filter.go index a4b090f..d704ad8 100644 --- a/runtime/ui/view/filter.go +++ b/runtime/ui/view/filter.go @@ -103,16 +103,6 @@ func (v *Filter) IsVisible() bool { return !v.hidden } -// CursorDown moves the cursor down in the filter pane (currently indicates nothing). -func (v *Filter) CursorDown() error { - return nil -} - -// CursorUp moves the cursor up in the filter pane (currently indicates nothing). -func (v *Filter) CursorUp() error { - return nil -} - // Edit intercepts the key press events in the filer view to update the file view in real time. func (v *Filter) Edit(view *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) { if !v.IsVisible() { diff --git a/runtime/ui/view/status.go b/runtime/ui/view/status.go index 3b53adc..59a9a53 100644 --- a/runtime/ui/view/status.go +++ b/runtime/ui/view/status.go @@ -65,16 +65,6 @@ func (v *Status) IsVisible() bool { return v != nil } -// CursorDown moves the cursor down in the details pane (currently indicates nothing). -func (v *Status) CursorDown() error { - return nil -} - -// CursorUp moves the cursor up in the details pane (currently indicates nothing). -func (v *Status) CursorUp() error { - return nil -} - // Update refreshes the state objects for future rendering (currently does nothing). func (v *Status) Update() error { return nil