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:
parent
75869f0ac3
commit
165fecbea0
6
eval.go
6
eval.go
@ -511,6 +511,9 @@ func update(app *app) {
|
|||||||
switch {
|
switch {
|
||||||
case gOpts.incsearch && app.ui.cmdPrefix == "/":
|
case gOpts.incsearch && app.ui.cmdPrefix == "/":
|
||||||
app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight)
|
app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight)
|
||||||
|
if app.nav.search == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
dir := app.nav.currDir()
|
dir := app.nav.currDir()
|
||||||
old := dir.ind
|
old := dir.ind
|
||||||
@ -525,6 +528,9 @@ func update(app *app) {
|
|||||||
}
|
}
|
||||||
case gOpts.incsearch && app.ui.cmdPrefix == "?":
|
case gOpts.incsearch && app.ui.cmdPrefix == "?":
|
||||||
app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight)
|
app.nav.search = string(app.ui.cmdAccLeft) + string(app.ui.cmdAccRight)
|
||||||
|
if app.nav.search == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
dir := app.nav.currDir()
|
dir := app.nav.currDir()
|
||||||
old := dir.ind
|
old := dir.ind
|
||||||
|
Loading…
Reference in New Issue
Block a user