1
0

Initial space mounting support

This commit is contained in:
Zef Hemel
2022-07-06 12:18:33 +02:00
parent f1a7cc1fb7
commit 05edbfe305
5 changed files with 233 additions and 5 deletions
+2
View File
@@ -459,6 +459,7 @@ export class Editor {
await this.system.unloadAll();
console.log("(Re)loading plugs");
for (let pageInfo of this.space.listPlugs()) {
console.log("Loading plug", pageInfo.name);
let { text } = await this.space.readPage(pageInfo.name);
await this.system.load(JSON.parse(text), createIFrameSandbox);
}
@@ -587,6 +588,7 @@ export class Editor {
// console.log("Restoring selection state", pageState);
editorView.dispatch({
selection: pageState.selection,
scrollIntoView: true,
});
editorView.scrollDOM.scrollTop = pageState!.scrollTop;
}
-1
View File
@@ -24,7 +24,6 @@ function wrapLines(view: EditorView, wrapElements: WrapElement[]) {
from,
to,
enter: ({ type, from, to }) => {
const bodyText = doc.sliceString(from, to);
for (let wrapElement of wrapElements) {
if (type.name == wrapElement.selector) {
if (wrapElement.nesting) {