Vanessa 2025-04-17 23:43:58 +08:00
parent 8ece62c075
commit 4e13146e5e

View File

@ -329,7 +329,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return; return;
} }
if (event.shiftKey && (event.key === "ArrowLeft" || event.key === "ArrowRight")) { if (isNotCtrl(event) && event.shiftKey && (event.key === "ArrowLeft" || event.key === "ArrowRight")) {
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"); const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) { if (selectElements.length > 0) {
event.stopPropagation(); event.stopPropagation();
@ -704,7 +704,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
} else { } else {
// 修正光标上移至 \n 结尾的块时落点错误 https://github.com/siyuan-note/siyuan/issues/14443 // 修正光标上移至 \n 结尾的块时落点错误 https://github.com/siyuan-note/siyuan/issues/14443
const prevEditableElement = getContenteditableElement(previousElement) as HTMLElement; const prevEditableElement = getContenteditableElement(previousElement) as HTMLElement;
if (prevEditableElement && prevEditableElement.lastChild.nodeType === 3 && if (prevEditableElement && prevEditableElement.lastChild.nodeType === 3 &&
prevEditableElement.lastChild.textContent.endsWith("\n")) { prevEditableElement.lastChild.textContent.endsWith("\n")) {
prevEditableElement.lastChild.textContent = prevEditableElement.lastChild.textContent.replace(/\n$/, ""); prevEditableElement.lastChild.textContent = prevEditableElement.lastChild.textContent.replace(/\n$/, "");
} }