diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts index c7678238b..f5184e1e3 100644 --- a/app/src/protyle/util/resize.ts +++ b/app/src/protyle/util/resize.ts @@ -11,7 +11,7 @@ export const resize = (protyle: IProtyle) => { const MIN_ABS = 4; // 不能 clearTimeout,否则 split 时左侧无法 resize setTimeout(() => { - if(!protyle.disabled) { + if (!protyle.disabled) { const contentRect = protyle.contentElement.getBoundingClientRect(); protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => { if (item.querySelector(".av__title")) { @@ -28,11 +28,13 @@ export const resize = (protyle: IProtyle) => { } }); } - if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) { - protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber").forEach((block: HTMLElement) => { + protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber").forEach((block: HTMLElement) => { + if ((window.siyuan.config.editor.codeSyntaxHighlightLineNum && block.parentElement.getAttribute("lineNumber") !== "false" && + window.siyuan.config.editor.codeLineWrap && block.parentElement.getAttribute("linewrap") !== "false") || + (block.parentElement.getAttribute("lineNumber") === "true" && block.parentElement.getAttribute("linewrap") === "true")) { lineNumberRender(block); - }); - } + } + }); // 保持光标位置不变 https://ld246.com/article/1673704873983/comment/1673765814595#comments if (!protyle.disabled && protyle.toolbar.range) { let rangeRect = protyle.toolbar.range.getBoundingClientRect();