diff --git a/app/src/layout/dock/Graph.ts b/app/src/layout/dock/Graph.ts index ddc33c097..ec171ada5 100644 --- a/app/src/layout/dock/Graph.ts +++ b/app/src/layout/dock/Graph.ts @@ -726,7 +726,7 @@ export class Graph extends Model { return; } if (-1 < node.type.indexOf("tag")) { - openGlobalSearch(this.app, `#${node.id}#`, !window.siyuan.ctrlIsPressed); + openGlobalSearch(this.app, `#${node.id}#`, !window.siyuan.ctrlIsPressed, {method: 0}); return; } if (window.siyuan.shiftIsPressed) { diff --git a/app/src/layout/dock/Tag.ts b/app/src/layout/dock/Tag.ts index 0c6b63684..a5f6b2eaa 100644 --- a/app/src/layout/dock/Tag.ts +++ b/app/src/layout/dock/Tag.ts @@ -87,7 +87,7 @@ export class Tag extends Model { return; } } - openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed); + openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed, {method: 0}); }, rightClick: (element: HTMLElement, event: MouseEvent) => { openTagMenu(element, event, element.getAttribute("data-label")); diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 8366d5a1f..7e314070e 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -1681,7 +1681,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => { icon: "iconSearch", click() { /// #if !MOBILE - openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, false); + openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, false, {method: 0}); /// #else popSearch(protyle.app, { hasReplace: false, diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index ca5a7a4cf..2febb9670 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -391,7 +391,7 @@ export class Background { break; } else if (type === "open-search") { /// #if !MOBILE - openGlobalSearch(protyle.app, `#${target.textContent}#`, !window.siyuan.ctrlIsPressed); + openGlobalSearch(protyle.app, `#${target.textContent}#`, !window.siyuan.ctrlIsPressed, {method: 0}); /// #else popSearch(protyle.app, { hasReplace: false, diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index c9714074c..8476253e1 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2375,7 +2375,7 @@ export class WYSIWYG { const tagElement = hasClosestByAttribute(event.target, "data-type", "tag"); if (tagElement && !event.altKey) { /// #if !MOBILE - openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, !ctrlIsPressed); + openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, !ctrlIsPressed, {method: 0}); hideElements(["dialog"]); /// #else popSearch(protyle.app, { diff --git a/app/src/search/util.ts b/app/src/search/util.ts index e03e5354d..7fa8202f2 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -202,7 +202,7 @@ const saveKeyList = (type: "keys" | "replaceKeys", value: string) => { setStorageVal(Constants.LOCAL_SEARCHKEYS, window.siyuan.storage[Constants.LOCAL_SEARCHKEYS]); }; -export const openGlobalSearch = (app: App, text: string, replace: boolean) => { +export const openGlobalSearch = (app: App, text: string, replace: boolean, searchData?: Config.IUILayoutTabSearchConfig) => { text = text.trim(); const searchModel = getAllModels().search.find((item) => { item.parent.parent.switchTab(item.parent.headElement); @@ -219,7 +219,7 @@ export const openGlobalSearch = (app: App, text: string, replace: boolean) => { k: text, r: "", hasReplace: false, - method: localData.method, + method: searchData ? searchData.method : localData.method, hPath: "", idPath: [], group: localData.group,