Skip to content

Commit

Permalink
Allow adding multiple empty lines in editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
mycroft committed Oct 13, 2024
1 parent 6959929 commit f6cfe69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions public/editor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {EditorView, gutter, keymap, lineNumbers} from "@codemirror/view";
import {Compartment, EditorState, Facet, Line, SelectionRange} from "@codemirror/state";
import {indentLess} from "@codemirror/commands";
import {defaultKeymap, indentLess} from "@codemirror/commands";

document.addEventListener("DOMContentLoaded", () => {
EditorView.theme({}, {dark: true});
Expand All @@ -27,7 +27,10 @@ document.addEventListener("DOMContentLoaded", () => {
extensions: [
lineNumbers(),
gutter({class: "cm-mygutter"}),
keymap.of([{key: "Tab", run: customIndentMore, shift: indentLess}]),
keymap.of([
{key: "Tab", run: customIndentMore, shift: indentLess},
...defaultKeymap,
]),
indentSize.of(EditorState.tabSize.of(2)),
wrapMode.of([]),
indentType.of(txtFacet.of("space")),
Expand Down

0 comments on commit f6cfe69

Please sign in to comment.