Skip to main content

Module editor_shortcuts

Module editor_shortcuts 

Source
Expand description

The editors’ own rebindable commands: bold and the rest of RichTextEditor’s formatting (FormatShortcut), comment and duplicate in CodeEditor (CodeShortcut).

They work as the standard edit commands do (StandardEdit): a global shortcut whose id is also the intent name, and an action on each editor that runs it, so the focused editor answers. Where the standard set is registered in every tree, these exist only while an editor that runs them does: each editable instance declares them with register_shortcut_shared, and the shortcut goes with the last. A read-only viewer declares none. A settings UI therefore lists Bold only in an application that has a rich-text editor, and a user’s binding waits in the registry for the next one.

An application that binds one of these chords to a global shortcut of its own shares it with the editor’s while an editor exists.

Enums§

CodeShortcut
A command of CodeEditor. Its id is both the shortcut id and the intent name.
FormatShortcut
A formatting command of RichTextEditor. Its id is both the shortcut id and the intent name.

Constants§

CODE_CATEGORY
The settings-UI category of every CodeShortcut.
FORMAT_CATEGORY
The settings-UI category of every FormatShortcut.