Fix read only mode
parent
41d5743673
commit
d72983bde5
|
@ -197,7 +197,7 @@ export class Client implements ConfigContainer {
|
|||
this.ui.render(this.parent);
|
||||
|
||||
this.editorView = new EditorView({
|
||||
state: createEditorState(this, "", "", false),
|
||||
state: createEditorState(this, "", "", true),
|
||||
parent: document.getElementById("sb-editor")!,
|
||||
});
|
||||
|
||||
|
@ -499,6 +499,10 @@ export class Client implements ConfigContainer {
|
|||
await this.navigate({ page: lastPage });
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log("Focusing editor");
|
||||
this.focus();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
async initSpace(): Promise<SpacePrimitives> {
|
||||
|
@ -861,7 +865,6 @@ export class Client implements ConfigContainer {
|
|||
|
||||
rebuildEditorState() {
|
||||
const editorView = this.editorView;
|
||||
console.log("Rebuilding editor state");
|
||||
|
||||
if (this.currentPage) {
|
||||
editorView.setState(
|
||||
|
|
|
@ -80,7 +80,7 @@ export function createEditorState(
|
|||
...client.ui.viewState.uiOptions.vimMode ? [vim({ status: true })] : [],
|
||||
],
|
||||
[
|
||||
...readOnly || client.ui.viewState.uiOptions.forcedROMode
|
||||
...(readOnly || client.ui.viewState.uiOptions.forcedROMode)
|
||||
? [EditorView.editable.of(false)]
|
||||
: [],
|
||||
],
|
||||
|
|
|
@ -38,6 +38,7 @@ export class MainUI {
|
|||
return;
|
||||
}
|
||||
console.log("Delegated keydown", ev, "to editor");
|
||||
client.focus();
|
||||
if (runScopeHandlers(client.editorView, ev, "editor")) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue