Skip to content

CommandEditorSuggest.onTrigger method

CommandEditorSuggest › onTrigger

Decides whether the suggest opens. While a command-opened session lasts, the query is the text from where it was opened to the cursor; otherwise CommandEditorSuggest.onTextTrigger decides.

Signature:

onTrigger(cursor: EditorPosition, editor: Editor, file: TFile | null): EditorSuggestTriggerInfo | null

Parameters:

ParameterTypeDescription
cursorEditorPositionThe cursor.
editorEditorThe editor.
fileTFile | nullThe file open in the editor.

Returns: EditorSuggestTriggerInfo | null — The trigger info, or null to stay closed.