mirror of
https://github.com/Kong/insomnia.git
synced 2026-07-30 09:16:44 -04:00
The Edit menu's Undo/Redo used role: 'undo'/'redo', driving only the native webContents stack. On macOS the menu accelerator swallows Cmd+Z before CodeMirror's keymap, so CodeMirror surfaces had no working undo — two competing stacks with the native one always winning and doing nothing useful for CM. Menu Undo/Redo now send edit:undo/edit:redo to the focused window; a single renderer handler (editor-undo.ts, wired in renderer-listeners.ts) routes by focus: CodeMirror surfaces drive cm.undo()/redo(); everything else replays the native execCommand, preserving prior plain-input behaviour. No double-fire: the accelerator still keeps CM's own keymap from firing independently.