1
1
mirror of https://github.com/walles/moar.git synced 2024-09-17 15:07:11 +03:00

Reset search on new '/'

This commit is contained in:
Johan Walles 2019-06-30 22:15:27 +02:00
parent 0646c58a5f
commit 9693c91aac

View File

@ -120,6 +120,7 @@ func (p *_Pager) _UpdateSearchPattern() {
}
defer p._ScrollToSearchHits()
// FIXME: Indicate to user if we didn't find anything
pattern, err := regexp.Compile(p.searchString)
if err == nil {
@ -236,6 +237,8 @@ func (p *_Pager) _OnRune(logger *log.Logger, char rune) {
case '/':
p.isSearching = true
p.searchString = ""
p.searchPattern = nil
default:
logger.Printf("Unhandled rune keyress '%s'", string(char))