fix(editor): Enable explicit undo keyboard shortcut across all code editors (#8178)

Fixes [ADO-801](https://linear.app/n8n/issue/ADO-801),
[PAY-632](https://linear.app/n8n/issue/PAY-632), and
[PAY-730](https://linear.app/n8n/issue/PAY-730)
Also fixes #5297

## Review / Merge checklist
- [x] PR title and summary are descriptive
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-12-28 14:55:23 +01:00
committed by GitHub
parent e418d42450
commit cf7f6688ba
9 changed files with 106 additions and 84 deletions

View File

@@ -6,7 +6,7 @@
import { defineComponent } from 'vue';
import { EditorView, keymap } from '@codemirror/view';
import { EditorState, Prec } from '@codemirror/state';
import { history, redo } from '@codemirror/commands';
import { history, redo, undo } from '@codemirror/commands';
import { workflowHelpers } from '@/mixins/workflowHelpers';
import { expressionManager } from '@/mixins/expressionManager';
@@ -26,12 +26,15 @@ export default defineComponent({
props: {
modelValue: {
type: String,
required: true,
},
path: {
type: String,
required: true,
},
isReadOnly: {
type: Boolean,
default: false,
},
},
data() {
@@ -56,6 +59,7 @@ export default defineComponent({
return false;
},
},
{ key: 'Mod-z', run: undo },
{ key: 'Mod-Shift-z', run: redo },
]),
),