mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
0d36150f19
commit
32e8099086
1 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ export function Autocomplete(props: {
|
|||
position: { x: 0, y: 0, width: 0 },
|
||||
})
|
||||
const filter = createMemo(() => {
|
||||
if (!store.visible) return ""
|
||||
if (!store.visible) return
|
||||
return props.value.substring(store.index + 1).split(" ")[0]
|
||||
})
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ export function Autocomplete(props: {
|
|||
if (store.visible === "/") return []
|
||||
const result = await sdk.find.files({
|
||||
query: {
|
||||
query: filter(),
|
||||
query: filter() ?? "",
|
||||
},
|
||||
})
|
||||
if (result.error) return []
|
||||
|
|
@ -166,7 +166,7 @@ export function Autocomplete(props: {
|
|||
(x) => x.disabled !== true,
|
||||
)
|
||||
if (!filter()) return mixed
|
||||
const result = fuzzysort.go(filter(), mixed, {
|
||||
const result = fuzzysort.go(filter()!, mixed, {
|
||||
keys: ["display", "description"],
|
||||
})
|
||||
return result.map((arr) => arr.obj)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue