This commit is contained in:
Alex Goodman 2019-02-18 08:05:09 -05:00
parent 184d3a2b0c
commit 96e9e2561d
No known key found for this signature in database
GPG Key ID: 743640FAA11698A1
2 changed files with 6 additions and 8 deletions

View File

@ -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) {

View File

@ -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
}