From 165fecbea03f1b38bf53f4fbb075f16e41b73fad Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Sat, 1 Oct 2022 09:33:22 -0400 Subject: [PATCH] Fix minor incsearch weirdness (#944) This fixes an issue where if you stared a search then deleted the search text (with e.g. backspace) it would perform a search for the empty string and move the selection to the next file. --- eval.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eval.go b/eval.go index 368277be..085002ed 100644 --- a/eval.go +++ b/eval.go @@ -511,6 +511,9 @@ func update(app *app) { switch { case gOpts.incsearch && app.ui.cmdPrefix == "/": app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight) + if app.nav.search == "" { + return + } dir := app.nav.currDir() old := dir.ind @@ -525,6 +528,9 @@ func update(app *app) { } case gOpts.incsearch && app.ui.cmdPrefix == "?": app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight) + if app.nav.search == "" { + return + } dir := app.nav.currDir() old := dir.ind