Skip to content

Commit

Permalink
Add history
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 12, 2023
1 parent 8d39fca commit 428212c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion squint-demo/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { EditorView, drawSelection, keymap } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { syntaxHighlighting, defaultHighlightStyle, foldGutter } from '@codemirror/language';
import { javascript } from '@codemirror/lang-javascript';
import { history, historyKeymap } from '@codemirror/commands';

let theme = EditorView.theme({
".cm-content": {whitespace: "pre-wrap",
Expand All @@ -25,12 +26,13 @@ let theme = EditorView.theme({
"&.cm-focused .cm-cursor": {visibility: "visible"}
});

let extensions = [
let extensions = [ history(),
theme,
foldGutter(),
syntaxHighlighting(defaultHighlightStyle),
drawSelection(),
keymap.of(complete_keymap),
keymap.of(historyKeymap),
...default_extensions
];

Expand Down

0 comments on commit 428212c

Please sign in to comment.