mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-03 19:30:16 +01:00
This commit is contained in:
parent
a87f096fb1
commit
c20da40cd7
9 changed files with 32 additions and 26 deletions
|
|
@ -4,6 +4,7 @@ import {Model} from "../layout/Model";
|
|||
import {disabledProtyle} from "../protyle/util/onGet";
|
||||
import {setPadding} from "../protyle/ui/initUI";
|
||||
import {getAllModels} from "../layout/getAll";
|
||||
import {countBlockWord} from "../layout/status";
|
||||
|
||||
export class Editor extends Model {
|
||||
public element: HTMLElement;
|
||||
|
|
@ -60,6 +61,7 @@ export class Editor extends Model {
|
|||
}
|
||||
});
|
||||
}
|
||||
countBlockWord([], editor.protyle.block.rootID);
|
||||
},
|
||||
});
|
||||
// 需在 after 回调之前,否则不会聚焦 https://github.com/siyuan-note/siyuan/issues/5303
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackSt
|
|||
if (focus) {
|
||||
if (protyle.toolbar.range) {
|
||||
focusByRange(protyle.toolbar.range);
|
||||
countSelectWord(protyle.toolbar.range);
|
||||
countSelectWord(protyle.toolbar.range, protyle.block.rootID);
|
||||
if (pushBackStack && protyle.preview.element.classList.contains("fn__none")) {
|
||||
pushBack(protyle, protyle.toolbar.range);
|
||||
}
|
||||
|
|
@ -326,8 +326,7 @@ export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackSt
|
|||
if (pushBackStack && protyle.preview.element.classList.contains("fn__none")) {
|
||||
pushBack(protyle, undefined, protyle.wysiwyg.element.firstElementChild);
|
||||
}
|
||||
// 用于清空状态栏字数统计
|
||||
countBlockWord([]);
|
||||
countBlockWord([], protyle.block.rootID);
|
||||
}
|
||||
}
|
||||
if (window.siyuan.config.fileTree.alwaysSelectOpenedFile && protyle) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue