make search cyclic

Mentioned in #57.
This commit is contained in:
Gokcehan 2017-01-07 17:42:33 +03:00
parent a704248696
commit 8689d712a3

12
nav.go
View File

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