Skip to content

Commit 3d69e77

Browse files
committed
fix: Allow multi word query
1 parent 3ae0e1a commit 3d69e77

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/internal/ui/zoxide/model.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"log/slog"
66
"slices"
7+
"strings"
78

89
"github.com/yorukot/superfile/src/internal/ui"
910
"github.com/yorukot/superfile/src/internal/ui/rendering"
@@ -118,10 +119,10 @@ func (m *Model) updateSuggestions() {
118119
return
119120
}
120121

121-
query := m.textInput.Value()
122+
query := strings.Fields(m.textInput.Value())
122123

123124
// Query zoxide with the current input (empty string shows all results)
124-
results, err := m.zClient.QueryAll(query)
125+
results, err := m.zClient.QueryAll(query...)
125126
if err != nil {
126127
slog.Debug("Failed to get zoxide suggestions", "query", query, "error", err)
127128
m.results = []zoxidelib.Result{}

0 commit comments

Comments
 (0)