diff --git a/gui/src/components/mainInput/handleMetaKeyIssues.ts b/gui/src/components/mainInput/handleMetaKeyIssues.ts index 867203a14..baf824bd6 100644 --- a/gui/src/components/mainInput/handleMetaKeyIssues.ts +++ b/gui/src/components/mainInput/handleMetaKeyIssues.ts @@ -48,6 +48,11 @@ export const handleVSCMetaKeyIssues = async ( x: () => handleCutOperation(text, editor), c: () => handleCopyOperation(text), v: () => handlePasteOperation(editor), + z: () => { + return e.shiftKey + ? handleRedoOperation(editor) + : handleUndoOperation(editor); + }, }; if (e.key in handlers) { @@ -130,3 +135,11 @@ export const handlePasteOperation = async (editor: Editor) => { document.execCommand("paste"); } }; + +export const handleUndoOperation = async (editor: Editor) => { + editor.commands.undo(); +}; + +export const handleRedoOperation = async (editor: Editor) => { + editor.commands.redo(); +};