Skip to main content

Module mode

Module mode 

Source
Expand description

T.3 — TutorMode minor mode + headerline provider.

TutorMode is a marker minor mode activated on the tutor buffer by do_tutor. It owns:

  • the <CR> / :tutor-next / :tutor-prev keymap layer
  • TutorHeaderlineProvider — emits a single virtual row above line 0 showing lesson/exercise progress and the current hint.

T.4 wires TutorSession as a BufferLocal and populates the headerline’s TutorViewState from the live session.

Structs§

TutorHeaderlineState
Buffer-local handle for updating the tutor headerline. Wraps a SimpleHeaderlineHandle<TutorViewState> so dispatch can push session state without holding a reference to the provider itself.
TutorMode
tutor-mode minor mode. Marker bit: activated on the tutor buffer by do_tutor; the keymap layer (keyed by this mode’s ModeId) gates the <CR>/:tutor-next/:tutor-prev chords so they are invisible on non-tutor buffers.
TutorViewState
Display state for the tutor headerline. Updated by T.4 when the session advances or a hint becomes active.

Enums§

TutorHudKind
Selects which HUD variant to render.

Constants§

TUTOR_PROVIDER_TAG

Functions§

register_tutor_modes
Register tutor-mode against registry. Called from the editor boot path before translate_mode_keymaps runs the K.2.4 pass that picks up TutorMode::keymap().
render_tutor_headerline
Render function for SimpleHeaderlineHandle<TutorViewState>.