From 96e9e2561df9a9e5a81891ca3eede801b97c2cf1 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 18 Feb 2019 08:05:09 -0500 Subject: [PATCH] gofmt --- ui/layerview.go | 8 +++----- ui/ui.go | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/layerview.go b/ui/layerview.go index 0179e06..dcf5617 100644 --- a/ui/layerview.go +++ b/ui/layerview.go @@ -128,7 +128,6 @@ func (view *LayerView) height() uint { return uint(height - 1) } - // IsVisible indicates if the layer view pane is currently initialized. func (view *LayerView) IsVisible() bool { if view == nil { @@ -139,11 +138,11 @@ func (view *LayerView) IsVisible() bool { // PageDown moves to next page putting the cursor on top func (view *LayerView) PageDown() error { - step := int(view.height())+1 + step := int(view.height()) + 1 targetLayerIndex := view.LayerIndex + step if targetLayerIndex > len(view.Layers) { - step -= targetLayerIndex - (len(view.Layers) -1) + step -= targetLayerIndex - (len(view.Layers) - 1) targetLayerIndex = view.LayerIndex + step } @@ -158,7 +157,7 @@ func (view *LayerView) PageDown() error { // PageUp moves to previous page putting the cursor on top func (view *LayerView) PageUp() error { - step := int(view.height())+1 + step := int(view.height()) + 1 targetLayerIndex := view.LayerIndex - step if targetLayerIndex < 0 { @@ -175,7 +174,6 @@ func (view *LayerView) PageUp() error { return nil } - // CursorDown moves the cursor down in the layer pane (selecting a higher layer). func (view *LayerView) CursorDown() error { if view.LayerIndex < len(view.Layers) { diff --git a/ui/ui.go b/ui/ui.go index 58a5e1e..c9a0fa7 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -110,12 +110,12 @@ func toggleFilterView(g *gocui.Gui, v *gocui.View) error { // CursorDown moves the cursor down in the currently selected gocui pane, scrolling the screen as needed. func CursorDown(g *gocui.Gui, v *gocui.View) error { - return CursorStep(g, v,1) + return CursorStep(g, v, 1) } // CursorUp moves the cursor up in the currently selected gocui pane, scrolling the screen as needed. func CursorUp(g *gocui.Gui, v *gocui.View) error { - return CursorStep(g, v,-1) + return CursorStep(g, v, -1) } // Moves the cursor the given step distance, setting the origin to the new cursor line @@ -123,7 +123,7 @@ func CursorStep(g *gocui.Gui, v *gocui.View, step int) error { cx, cy := v.Cursor() // if there isn't a next line - line, err := v.Line(cy+step) + line, err := v.Line(cy + step) if err != nil { // todo: handle error }