working with monaco anys

This commit is contained in:
Olivier Gagnon
2022-07-19 20:10:30 -04:00
parent 0c07dddb36
commit dfadfe6eb2
3 changed files with 10 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef, useMemo } from "react";
import Editor, { Monaco } from "@monaco-editor/react";
import Editor from "@monaco-editor/react";
import * as monaco from "monaco-editor";
import type { Monaco } from "@monaco-editor/react";
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
type ITextModel = monaco.editor.ITextModel;
@@ -195,7 +196,6 @@ export function Root(props: IProps): React.ReactElement {
try {
// @ts-expect-error
window.require(["monaco-vim"], function (MonacoVim: any) {
console.log(MonacoVim);
setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));
MonacoVim.VimMode.Vim.defineEx("write", "w", function () {
// your own implementation on what you want to do when :w is pressed