Fixes #319
This commit is contained in:
+2
-1
@@ -149,7 +149,6 @@ export class Editor {
|
||||
|
||||
// Runtime state (that doesn't make sense in viewState)
|
||||
collabState?: CollabState;
|
||||
// enableVimMode = false;
|
||||
|
||||
constructor(
|
||||
space: Space,
|
||||
@@ -332,6 +331,7 @@ export class Editor {
|
||||
}
|
||||
});
|
||||
|
||||
// Need to find a nicer way of doing this stuff
|
||||
if (this.builtinSettings.fontFamily) {
|
||||
document.getElementById("sb-root")!.setAttribute(
|
||||
"style",
|
||||
@@ -1067,6 +1067,7 @@ export class Editor {
|
||||
|
||||
useEffect(() => {
|
||||
this.rebuildEditorState();
|
||||
this.dispatchAppEvent("editor:modeswitch");
|
||||
}, [viewState.uiOptions.vimMode]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Editor } from "../editor.tsx";
|
||||
import { EditorView, Transaction } from "../deps.ts";
|
||||
import { EditorView, Transaction, Vim, vimGetCm } from "../deps.ts";
|
||||
import { SysCallMapping } from "../../plugos/system.ts";
|
||||
import { FilterOption } from "../../common/types.ts";
|
||||
|
||||
@@ -164,6 +164,10 @@ export function editorSyscalls(editor: Editor): SysCallMapping {
|
||||
value,
|
||||
});
|
||||
},
|
||||
"editor.vimEx": (_ctx, exCommand: string) => {
|
||||
const cm = vimGetCm(editor.editorView!)!;
|
||||
return Vim.handleEx(cm, exCommand);
|
||||
},
|
||||
};
|
||||
|
||||
return syscalls;
|
||||
|
||||
Reference in New Issue
Block a user