feat: only when math if hit enter result gets placed on the search bar

This commit is contained in:
Andre Henriques 2025-06-06 10:51:12 +01:00
parent 6506df75b4
commit 4608099a56
2 changed files with 5 additions and 1 deletions

2
app.go
View File

@ -214,7 +214,7 @@ func updateRemeberPath(a *App, value string) {
}
}
err = os.WriteFile(remeberPath, []byte(strings.Join(nlist, "\n")), 0644)
err = os.WriteFile(remeberPath, []byte(strings.Join(nlist, "\n")+"\n"), 0644)
if err != nil {
os.Exit(1)
return

View File

@ -77,6 +77,10 @@
}
selectedI = Math.max(selectedI - 1, 0);
} else if (e.key === "Enter") {
if (remeberSearch.length === 0 && search.length === 0 && mathRes) {
searchText = mathRes;
return;
}
if (selectedI < remeberSearch.length) {
EnterDir(remeberSearch[selectedI]);
return;