Skip to content

Commit 58e97e0

Browse files
committedNov 12, 2024
1 parent a412018 commit 58e97e0

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed
 

‎app/src/layout/dock/Graph.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ export class Graph extends Model {
726726
return;
727727
}
728728
if (-1 < node.type.indexOf("tag")) {
729-
openGlobalSearch(this.app, `#${node.id}#`, !window.siyuan.ctrlIsPressed);
729+
openGlobalSearch(this.app, `#${node.id}#`, !window.siyuan.ctrlIsPressed, {method: 0});
730730
return;
731731
}
732732
if (window.siyuan.shiftIsPressed) {

‎app/src/layout/dock/Tag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Tag extends Model {
8787
return;
8888
}
8989
}
90-
openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed);
90+
openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed, {method: 0});
9191
},
9292
rightClick: (element: HTMLElement, event: MouseEvent) => {
9393
openTagMenu(element, event, element.getAttribute("data-label"));

‎app/src/menus/protyle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {
16811681
icon: "iconSearch",
16821682
click() {
16831683
/// #if !MOBILE
1684-
openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, false);
1684+
openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, false, {method: 0});
16851685
/// #else
16861686
popSearch(protyle.app, {
16871687
hasReplace: false,

‎app/src/protyle/header/Background.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export class Background {
391391
break;
392392
} else if (type === "open-search") {
393393
/// #if !MOBILE
394-
openGlobalSearch(protyle.app, `#${target.textContent}#`, !window.siyuan.ctrlIsPressed);
394+
openGlobalSearch(protyle.app, `#${target.textContent}#`, !window.siyuan.ctrlIsPressed, {method: 0});
395395
/// #else
396396
popSearch(protyle.app, {
397397
hasReplace: false,

‎app/src/protyle/wysiwyg/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ export class WYSIWYG {
23752375
const tagElement = hasClosestByAttribute(event.target, "data-type", "tag");
23762376
if (tagElement && !event.altKey) {
23772377
/// #if !MOBILE
2378-
openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, !ctrlIsPressed);
2378+
openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, !ctrlIsPressed, {method: 0});
23792379
hideElements(["dialog"]);
23802380
/// #else
23812381
popSearch(protyle.app, {

‎app/src/search/util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const saveKeyList = (type: "keys" | "replaceKeys", value: string) => {
202202
setStorageVal(Constants.LOCAL_SEARCHKEYS, window.siyuan.storage[Constants.LOCAL_SEARCHKEYS]);
203203
};
204204

205-
export const openGlobalSearch = (app: App, text: string, replace: boolean) => {
205+
export const openGlobalSearch = (app: App, text: string, replace: boolean, searchData?: Config.IUILayoutTabSearchConfig) => {
206206
text = text.trim();
207207
const searchModel = getAllModels().search.find((item) => {
208208
item.parent.parent.switchTab(item.parent.headElement);
@@ -219,7 +219,7 @@ export const openGlobalSearch = (app: App, text: string, replace: boolean) => {
219219
k: text,
220220
r: "",
221221
hasReplace: false,
222-
method: localData.method,
222+
method: searchData ? searchData.method : localData.method,
223223
hPath: "",
224224
idPath: [],
225225
group: localData.group,

0 commit comments

Comments
 (0)
Please sign in to comment.