5bc2acad25
Typing a header line above the draft marker (`#`/`##`/… + the start of a field name) now shows an autocomplete popup: Tab/Enter or click to insert "Field: ", Up/Down to choose, Esc to dismiss (and stay dismissed until the partial changes). It never triggers in the prose below the marker. Suggestions combine a built-in list (Title, Slug, POV, Word Count Target, Characters, Setting, Conflict, …) with field names learned from every file's header, refreshed on open and merged on save, so custom fields autocomplete too. Implementation: the editor gets a stable id so completions can drive its cursor/focus; nav keys are consumed before the TextEdit sees them, and the popup is recomputed from the caret each frame. Pure helpers (header_completion_context, field_matches, header_field_names) are unit tested; 50 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9kRuP7JvXoUGdNNeg5ZSs