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

@@ -86,6 +86,7 @@ export default defineComponent({
mode: {
type: String as PropType<CodeExecutionMode>,
validator: (value: CodeExecutionMode): boolean => CODE_EXECUTION_MODES.includes(value),
required: true,
},
language: {
type: String as PropType<CodeNodeEditorLanguage>,
@@ -103,6 +104,7 @@ export default defineComponent({
},
modelValue: {
type: String,
required: true,
},
},
setup() {

View File

@@ -16,6 +16,7 @@ import {
toggleComment,
redo,
deleteCharBackward,
undo,
} from '@codemirror/commands';
import { lintGutter } from '@codemirror/lint';
import type { Extension } from '@codemirror/state';
@@ -43,6 +44,7 @@ export const writableEditorExtensions: readonly Extension[] = [
{ key: 'Tab', run: acceptCompletion },
{ key: 'Enter', run: acceptCompletion },
{ key: 'Mod-/', run: toggleComment },
{ key: 'Mod-z', run: undo },
{ key: 'Mod-Shift-z', run: redo },
{ key: 'Backspace', run: deleteCharBackward, shift: deleteCharBackward },
indentWithTab,