EditorStateBuilder

Builder scope for constructing an EditorState via DSL.

Example:

val state = editorState {
doc("Hello, world!")
selection(5)
extensions {
+lineNumbers
+history()
+bracketMatching()
}
}

Functions

Link copied to clipboard
fun doc(text: Text)

Set the initial document content from a Text.

fun doc(content: String)

Set the initial document content from a string.

Link copied to clipboard

Set a single extension.

Link copied to clipboard

Build the extension list using a DSL block.

Link copied to clipboard
fun selection(cursor: DocPos)

Set the initial cursor position.

fun selection(selection: EditorSelection)

Set the initial selection from an EditorSelection.

fun selection(anchor: DocPos, head: DocPos)

Set the initial selection as a range.