mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Improve asset search highlighting https://github.com/siyuan-note/siyuan/issues/15370
This commit is contained in:
parent
7476372054
commit
9d392bd663
1 changed files with 3 additions and 1 deletions
|
|
@ -343,7 +343,9 @@ func SearchAssetsByName(keyword string, exts []string) (ret []*cache.Asset) {
|
||||||
ret = []*cache.Asset{}
|
ret = []*cache.Asset{}
|
||||||
var keywords []string
|
var keywords []string
|
||||||
keywords = append(keywords, keyword)
|
keywords = append(keywords, keyword)
|
||||||
|
if "" != keyword {
|
||||||
keywords = append(keywords, strings.Split(keyword, " ")...)
|
keywords = append(keywords, strings.Split(keyword, " ")...)
|
||||||
|
}
|
||||||
pathHitCount := map[string]int{}
|
pathHitCount := map[string]int{}
|
||||||
filterByExt := 0 < len(exts)
|
filterByExt := 0 < len(exts)
|
||||||
for _, asset := range cache.GetAssets() {
|
for _, asset := range cache.GetAssets() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue