Repository navigation
feat(shortcuts): list Undo, Redo, Cut, Copy and Paste in the shortcuts panel - #1049
Merged
Merged
Conversation
…s panel Undo and Redo are Monaco's own commands, so their rows name the Monaco command and editor.chords.spec.ts checks them against Monaco's keymap. toMonacoLabel moves into keymapHarness so that spec can use it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #997. After 2.9.0 added Undo and Redo to the editor's right-click menu, the reporter asked for them in Settings › Shortcuts too. The panel now lists Undo, Redo, Cut, Copy and Paste at the top of Edit. A toolbar button is not part of this: the toolbar is already full.
Cut, Copy and Paste are the app's own bindings (
cutToClipboard,custom-copy,pasteFromClipboard), so their rows use the existingeditorCommandandeditorActionchecks. The registry had left them out on purpose, so that exclusion and the matching exemption lists in the tests are removed. Undo and Redo are Monaco's own commands, and nothing the existing checks read can confirm them. Those rows get a newmonacoCommandfield. A test ineditor.chords.spec.tschecks each such row against Monaco's real keymap on all three platforms, and also checks that the app doesn't bind the chord itself. Redo shows onlyMod+Shift+Z, becauseMod+Yis not bound on macOS and a row has one chord list for every platform.toMonacoLabelmoves intokeymapHarness.tsso the spec can use it, which also removes the two copies in the shortcuts tests.Verified:
npm test(945 pass),npm run test:vitest(741 pass),npm run check, eslint on the changed files. Changing Redo's chord toMod+Ymakes the new spec fail with "macOS: edit-redo (Meta+Y) is not Monaco's redo". On a macOS release test bundle, Settings › Shortcuts shows the five rows with Cmd+Z, Cmd+Shift+Z, Cmd+X, Cmd+C and Cmd+V. Not checked on Windows or Linux.