mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance: select match
This commit is contained in:
@@ -144,9 +144,23 @@
|
||||
(not exact-match?)
|
||||
(not (string/blank? @*input))
|
||||
(not (exact-match-exclude-items @*input)))
|
||||
(->>
|
||||
(cons new-option search-result')
|
||||
(remove nil?))
|
||||
(let [current-input (exact-transform-fn @*input)
|
||||
matches? (some (fn [item]
|
||||
(and (string? item)
|
||||
(string? current-input)
|
||||
(string/includes?
|
||||
(string/lower-case item)
|
||||
(string/lower-case current-input))))
|
||||
(set (map (comp exact-transform-fn str extract-fn) search-result')))]
|
||||
(->>
|
||||
(if matches?
|
||||
(cons
|
||||
(first search-result')
|
||||
(cons
|
||||
new-option
|
||||
(rest search-result')))
|
||||
(cons new-option search-result'))
|
||||
(remove nil?)))
|
||||
search-result')
|
||||
input-opts' (if (fn? input-opts) (input-opts (empty? search-result)) input-opts)
|
||||
input-container (or
|
||||
|
||||
Reference in New Issue
Block a user