<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`Command`](Command) › [`editorCallback`](Command/editorCallback) ## Command.editorCallback property A command callback that is only triggered when the user is in an editor. Overrides `callback` and `checkCallback` **Signature:** ```typescript editorCallback?: (editor: Editor, ctx: MarkdownView | MarkdownFileInfo) => any; ``` ## Example ```ts this.addCommand({ id: 'example-command', name: 'Example command', editorCallback: (editor: Editor, view: MarkdownView) => { const sel = editor.getSelection(); console.log(`You have selected: ${sel}`); } }); ``` 0.12.2