This commit is contained in:
Vanessa 2023-12-23 00:00:10 +08:00
parent f5ff8f74c2
commit 07aa1e077c
4 changed files with 14 additions and 8 deletions

View file

@ -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;
}