Skip to main content

Module trigger

Module trigger 

Source

Structs§

TriggerContext
TriggerOptions
Per-call knobs for detect_trigger_with.

Enums§

TriggerKind

Traits§

ZoneOracle
Lazily answers the two exclusion-zone queries the trigger veto needs. Consulted ONLY after a wikilink/hashtag opener is found in the local backward scan, so a keystroke with no trigger candidate never pays for the full-buffer ExclusionZones scan (pulldown + regex). Implementors decide whether to precompute, recompute, or memoize.

Functions§

detect_trigger
Inspect text at cursor (a byte offset) and decide whether an autocomplete popup should be active.
detect_trigger_with
Variant of detect_trigger that takes explicit options. Used by the search-box controller to suppress the column-0 # header disambiguation, which only matters in the Markdown editor.
detect_trigger_with_oracle
Core trigger detection. The local backward scan from cursor runs unconditionally; oracle is consulted only at the exclusion veto, reached only once a [[/# opener has been found — so the caller’s zone computation can stay lazy.
detect_trigger_with_zones
Variant of detect_trigger_with that accepts a precomputed ExclusionZones for the same text. When zones is None, the exclusion check recomputes per call (used by tests and the no-cache convenience function). Thin wrapper over detect_trigger_with_oracle.