|
@@ -171,6 +171,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|
nodeElement.querySelector("wbr").remove();
|
|
nodeElement.querySelector("wbr").remove();
|
|
// 光标位于引用结尾后 ctrl+b 偶尔会失效
|
|
// 光标位于引用结尾后 ctrl+b 偶尔会失效
|
|
range = cloneRange;
|
|
range = cloneRange;
|
|
|
|
+ // 会导致 protyle.toolbar.range 和 range 不一致,先在有问题的地方重置一下 https://github.com/siyuan-note/siyuan/issues/10933
|
|
}
|
|
}
|
|
|
|
|
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
|
@@ -594,6 +595,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const selectText = range.toString();
|
|
const selectText = range.toString();
|
|
|
|
+
|
|
// 上下左右光标移动
|
|
// 上下左右光标移动
|
|
if (!event.altKey && !event.shiftKey && isNotCtrl(event) && !event.isComposing && (event.key.indexOf("Arrow") > -1)) {
|
|
if (!event.altKey && !event.shiftKey && isNotCtrl(event) && !event.isComposing && (event.key.indexOf("Arrow") > -1)) {
|
|
// 需使用 editabled,否则代码块会把语言字数算入
|
|
// 需使用 editabled,否则代码块会把语言字数算入
|
|
@@ -1242,7 +1244,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
if (matchHotKey(menuItem.hotkey, event)) {
|
|
if (matchHotKey(menuItem.hotkey, event)) {
|
|
- protyle.toolbar.range = getEditorRange(protyle.wysiwyg.element);
|
|
|
|
|
|
+ // 设置 lastHTMLs 会导致 protyle.toolbar.range 和 range 不一致,需重置一下 https://github.com/siyuan-note/siyuan/issues/10933
|
|
|
|
+ protyle.toolbar.range = range;
|
|
if (["block-ref"].includes(menuItem.name) && protyle.toolbar.range.toString() === "") {
|
|
if (["block-ref"].includes(menuItem.name) && protyle.toolbar.range.toString() === "") {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|