Done. Tab cycling implemented, tested, documented, and the design doc moved to #50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "repl-completion-cycling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
done/.
What landed
I dropped the prefix field the design sketched — it was flagged as
non-load-bearing ("retained only to document"), and keeping a write-only
field would trip the dead_code lint. base + candidates[idx] is all the cycle
needs.
last-applied candidate, advance idx (wrap to 0) and reapply; otherwise
compute fresh candidates (command or predicate via completion_mode), apply
the first, and stash the session. Empty-candidate Tab is a no-op (no session
created).
correctness guard so cycling can never apply to edited text. (Cursor moves,
typing, submit, cancel, Ctrl-C/D all end the cycle.)
Files
clear, the cycling complete(), + 5 tests.
other key ends the cycle").
Tests (+5, 516 total, all green; fmt + clippy clean)
atom/atom_chars/atom_concat/atom_length)
done/. What landed - CompletionState { base, candidates, idx } added to App (sibling to Paging). I dropped the prefix field the design sketched — it was flagged as non-load-bearing ("retained only to document"), and keeping a write-only field would trip the dead_code lint. base + candidates[idx] is all the cycle needs. - complete() rewritten: if a session is active and the line still equals the last-applied candidate, advance idx (wrap to 0) and reapply; otherwise compute fresh candidates (command or predicate via completion_mode), apply the first, and stash the session. Empty-candidate Tab is a no-op (no session created). - handle_key clears the session on any non-Tab key — the load-bearing correctness guard so cycling can never apply to edited text. (Cursor moves, typing, submit, cancel, Ctrl-C/D all end the cycle.) - Works uniformly for command and predicate modes. Files - crates/repl/src/app.rs — CompletionState, the completion field, the non-Tab clear, the cycling complete(), + 5 tests. - docs/repl-guide.md — completion bullet updated ("repeated Tab cycles… any other key ends the cycle"). - docs/design/done/REPL_COMPLETION_CYCLING.md — decision record. Tests (+5, 516 total, all green; fmt + clippy clean) - :l → :list → :load → wraps to :list - predicate cycling (atom → advances through atom/atom_chars/atom_concat/atom_length) - non-Tab key (cursor move) ends the cycle (session dropped) - empty-candidate Tab (:zzz) is a no-op, no session - edit-after-Tab recomputes from scratch (:l→:list, then :e→:edit)