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.
This commit is contained in:
1 parent
75869f0ac3
commit
165fecbea0
1 file changed
+6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user