diff --git a/nav.go b/nav.go index 69be244..71468c3 100644 --- a/nav.go +++ b/nav.go @@ -372,6 +372,12 @@ func (nav *nav) searchNext() { return } } + for i := 0; i < last.ind; i++ { + if strings.Contains(last.fi[i].Name(), nav.search) { + nav.up(last.ind - i) + return + } + } } func (nav *nav) searchPrev() { @@ -382,6 +388,12 @@ func (nav *nav) searchPrev() { return } } + for i := len(last.fi) - 1; i > last.ind; i-- { + if strings.Contains(last.fi[i].Name(), nav.search) { + nav.down(i - last.ind) + return + } + } } func (nav *nav) toggleMark(path string) {