diff --git a/app/src/boot/globalEvent/searchKeydown.ts b/app/src/boot/globalEvent/searchKeydown.ts index 13b42beab..22a2e084b 100644 --- a/app/src/boot/globalEvent/searchKeydown.ts +++ b/app/src/boot/globalEvent/searchKeydown.ts @@ -55,7 +55,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => { const isAsset = !assetsElement.classList.contains("fn__none"); const listElement = isAsset ? assetsElement.querySelector("#searchAssetList") : element.querySelector("#searchList"); const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement; - if (!isAsset && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event)) { + if (!isAsset && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event) && config.method === 0) { newFileByName(app, searchInputElement.value); return true; } @@ -82,7 +82,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => { return false; } if (currentList.getAttribute("data-type") === "search-new") { - if (event.key === "Enter") { + if (event.key === "Enter" && config.method === 0) { newFileByName(app, searchInputElement.value); return true; } diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 6779b6e2c..f600ef2c2 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -1953,7 +1953,7 @@ export class Gutter { } index += 1; const buttonHTML = ``; diff --git a/app/src/search/util.ts b/app/src/search/util.ts index e551720e9..660871130 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -861,7 +861,9 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo } else if (target.classList.contains("b3-list-item")) { const searchAssetInputElement = element.querySelector("#searchAssetInput") as HTMLInputElement; if (type === "search-new") { - newFileByName(app, searchInputElement.value); + if (config.method == 0) { + newFileByName(app, searchInputElement.value); + } } else if (type === "search-item") { const isAsset = target.dataset.id; let isClick = event.detail === 1; @@ -1349,8 +1351,8 @@ ${getAttr(item)} edit.protyle.element.classList.add("fn__none"); element.querySelector(".search__drag").classList.add("fn__none"); } - element.querySelector("#searchList").innerHTML = resultHTML || - `