From 6774ff0b812497beadb667f280b0ef997d7e991f Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 11 Jan 2018 19:37:33 +0300 Subject: [PATCH] keep current directory hierarchy in cache on renew Mentioned in #92. --- nav.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nav.go b/nav.go index 073b1ff..90b3c4d 100644 --- a/nav.go +++ b/nav.go @@ -272,6 +272,9 @@ func (nav *nav) getDirs(wd string) { func (nav *nav) renew(height int) { nav.dirCache = make(map[string]*dir) + for _, d := range nav.dirs { + nav.dirCache[d.path] = d + } nav.height = height for _, d := range nav.dirs {