From 428212c5d533994e7ce1009d54ec652ba935b436 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 12 Dec 2023 17:19:15 +0100 Subject: [PATCH] Add history --- squint-demo/index.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/squint-demo/index.mjs b/squint-demo/index.mjs index 1fa5ca6..1a5adad 100644 --- a/squint-demo/index.mjs +++ b/squint-demo/index.mjs @@ -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", @@ -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 ];