diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index 085b81568..3e00e91af 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -345,7 +345,7 @@ export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackSt } if (window.siyuan.config.fileTree.alwaysSelectOpenedFile && protyle) { const fileModel = getDockByType("file")?.data.file; - if (fileModel instanceof Files) { + if (fileModel instanceof Files && !fileModel.isSelected(protyle.path)) { fileModel.selectItem(protyle.notebookId, protyle.path); } } diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index 393be5830..f0e13c590 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -852,6 +852,21 @@ export class Files extends Model { liElement.insertAdjacentHTML("afterend", `