Skip to content

Commit

Permalink
Add support for basic scaling of horizontal gaps
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marijnh committed Sep 27, 2024
1 parent 7705642 commit 0943911
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions demo/demo.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {EditorView, basicSetup} from "codemirror"
import {javascript} from "@codemirror/lang-javascript"

;(window as any).view = new EditorView({
doc: 'console.log("Hello world")',
extensions: [
basicSetup,
javascript(),
],
let doc = ""
for (let i = 0; i <= 1245526; i++) doc += String.fromCharCode("a".charCodeAt(0) + Math.floor(Math.random() * 26))

let view = (window as any).view = new EditorView({
doc,
extensions: basicSetup,
parent: document.body
})

console.log("---")
view.dispatch({selection: {anchor: view.state.doc.length}, scrollIntoView: true})

0 comments on commit 0943911

Please sign in to comment.