Skip to content

Commit 0943911

Browse files
committed
Add support for basic scaling of horizontal gaps
FIX: Improve the way enormously long (non-wrapped) lines are displayed by making sure they stay shorter than the maximal pixel size the browser's CSS engine can handle. Closes #1448
1 parent 7705642 commit 0943911

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

demo/demo.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import {EditorView, basicSetup} from "codemirror"
2-
import {javascript} from "@codemirror/lang-javascript"
32

4-
;(window as any).view = new EditorView({
5-
doc: 'console.log("Hello world")',
6-
extensions: [
7-
basicSetup,
8-
javascript(),
9-
],
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,
109
parent: document.body
1110
})
11+
12+
console.log("---")
13+
view.dispatch({selection: {anchor: view.state.doc.length}, scrollIntoView: true})

0 commit comments

Comments
 (0)