Skip to content

Commit

Permalink
Fix minor incsearch weirdness (#944)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
p-ouellette authored Oct 1, 2022
1 parent 75869f0 commit 165fecb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 165fecb

Please sign in to comment.