Skip to main content

Module text_completion

Module text_completion 

Expand description

Inline completion in a text field: :shortcode offers the catalogue’s emoji and @name offers the workspace’s people and agents, in the one list beside the caret.

A field offers both by default; what it offers is a property of the field (TextCompletion), not of the app. A search field, a secret, a code editor or a URL is plain because : and @ are syntax there, not because completion is unavailable.

Both triggers share one keyboard-driven list: Up and Down move the armed row, Enter or Tab accepts it, Escape dismisses this token. Accepting replaces the token with the emoji character (a workspace emoji stays written :name:) or with the mention’s name as it will resolve. A field with an input method composition open offers nothing, so completion never competes with the input method for the same keys.

Structs§

EmojiQuery
The :shortcode the caret sits in.
TextCompletion
Which parts of a text field’s inline completion it offers.

Functions§

emoji_query_at_caret
The :shortcode ending at caret, if the caret sits in one: a : that opens a token, followed by at most MAX_SHORTCODE_LEN shortcode characters. None inside a word (10:30, a:smile) and for a token that already has its closing : after the typed part.