From 63e32e1685537f6174224d0f6915e314b0070380 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 14 Aug 2016 18:39:02 +0300 Subject: [PATCH] cleanup --- nav.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/nav.go b/nav.go index 794ab73..0aca05c 100644 --- a/nav.go +++ b/nav.go @@ -233,6 +233,20 @@ func (nav *Nav) renew(height int) { } } +func (nav *Nav) up() { + dir := nav.currDir() + + if dir.ind == 0 { + return + } + + dir.ind-- + + dir.pos-- + edge := min(gOpts.scrolloff, dir.ind) + dir.pos = max(dir.pos, edge) +} + func (nav *Nav) down() { dir := nav.currDir() @@ -250,20 +264,6 @@ func (nav *Nav) down() { dir.pos = min(dir.pos, maxind) } -func (nav *Nav) up() { - dir := nav.currDir() - - if dir.ind == 0 { - return - } - - dir.ind-- - - dir.pos-- - edge := min(gOpts.scrolloff, dir.ind) - dir.pos = max(dir.pos, edge) -} - func (nav *Nav) updir() error { if len(nav.dirs) <= 1 { return nil