Skip to content

Commit

Permalink
add undo history
Browse files Browse the repository at this point in the history
  • Loading branch information
ego-lay-atman-bay committed Feb 2, 2024
1 parent 16fd728 commit 11e1ecb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ <h1>
extensions: [
codemirror.view.keymap.of(codemirror.commands.defaultKeymap),
codemirror.view.keymap.of(codemirror.commands.indentWithTab),
codemirror.view.keymap.of([{
key: "Mod-z",
run: codemirror.commands.undo,
},
{
key: "Mod-Shift-z",
run: codemirror.commands.redo,
},
{
key: "Mod-y",
run: codemirror.commands.redo,
}]),
codemirror.language.indentUnit.of(' '),
codemirror.EditorView.updateListener.of((v) => {
if (v.docChanged) {
Expand All @@ -84,6 +96,7 @@ <h1>
}
}),
codemirror.view.placeholder('. . .'),
codemirror.commands.history(),
],
});

Expand Down

0 comments on commit 11e1ecb

Please sign in to comment.