Skip to content

Support partial shortcut overrides in ShortcutPlugin - #3450

Closed
Vi Nguyen (vinguyen12) wants to merge 1 commit into
masterfrom
u/nguyenvi/shortcut-plugin-override
Closed

Support partial shortcut overrides in ShortcutPlugin#3450
Vi Nguyen (vinguyen12) wants to merge 1 commit into
masterfrom
u/nguyenvi/shortcut-plugin-override

Conversation

@vinguyen12

@vinguyen12 Vi Nguyen (vinguyen12) commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Adds partial override support to ShortcutPlugin, allowing consumers to customize selected built-in shortcut keys without replacing the complete command list.

new ShortcutPlugin({
    shortcutOverrides: {
        bold: {
            modifierKey: 'ctrl',
            shiftKey: false,
            which: 78,
        },
    },
});

An override changes only the selected command's shortcut key. Its callback, environment, command identity, matching order, and all unaffected default shortcuts remain unchanged.

Backward compatibility

•  new ShortcutPlugin()  continues to use all built-in shortcuts.
•  new ShortcutPlugin(undefined)  continues to use all built-in shortcuts.
• Passing a  ShortcutCommand[]  continues to replace the complete built-in command list.
• Existing shortcut matching behavior and precedence are preserved.

API changes

Exports:

•  ShortcutPluginOptions 
•  DefaultShortcutCommandName 

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-27 19:19 UTC

@vinguyen12

Copy link
Copy Markdown
Contributor Author

Shortcuts are exported so we can build entire shortcut list in consumer apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant