From 70ec01fc3bdc0e088ddbafc41eab3f4eef810b56 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 6 Nov 2020 20:51:31 +0300 Subject: [PATCH] fix crash for 'bottom' at startup Related #498 --- nav.go | 1 + 1 file changed, 1 insertion(+) diff --git a/nav.go b/nav.go index 6d9526a..c67c311 100644 --- a/nav.go +++ b/nav.go @@ -252,6 +252,7 @@ func (dir *dir) sel(name string, height int) { return } + dir.ind = max(dir.ind, 0) dir.ind = min(dir.ind, len(dir.files)-1) if dir.files[dir.ind].Name() != name {