Browse Source

:art: https://ld246.com/article/1731373012221

Vanessa 8 months ago
parent
commit
58e97e0f07

+ 1 - 1
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) {

+ 1 - 1
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"));

+ 1 - 1
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,

+ 1 - 1
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,

+ 1 - 1
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, {

+ 2 - 2
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,