We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0943911 commit 814b062Copy full SHA for 814b062
demo/demo.ts
@@ -1,13 +1,11 @@
1
import {EditorView, basicSetup} from "codemirror"
2
+import {javascript} from "@codemirror/lang-javascript"
3
-let doc = ""
4
-for (let i = 0; i <= 1245526; i++) doc += String.fromCharCode("a".charCodeAt(0) + Math.floor(Math.random() * 26))
5
-
6
-let view = (window as any).view = new EditorView({
7
- doc,
8
- extensions: basicSetup,
+;(window as any).view = new EditorView({
+ doc: 'console.log("Hello world")',
+ extensions: [
+ basicSetup,
+ javascript(),
9
+ ],
10
parent: document.body
11
})
12
-console.log("---")
13
-view.dispatch({selection: {anchor: view.state.doc.length}, scrollIntoView: true})
0 commit comments