new vim-line with hist #529
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq!529
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "vim-line2"
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?
Review: Approve ✅
Clean, well-factored change with strong docs and test coverage. No blocking issues.
Verified (on
vim-line2)cargo build -p vim-line(no features) — clean; core stays dependency/IO-freecargo build -p vim-line --features history -p seq-repl— cleancargo test -p vim-line --features history— 46 + 1 passcargo test -p seq-repl— 82 passcargo clippy --features history --all-targets -- -D warnings— cleangrep std::fs|std::io crates/vim-line/src→ empty ✓save_historywritesstore.entries(), andload_historyseeds the store viaadd_entry→store.pushat startup — no restart regression ✓seq-replconsumes vim-line, so enabling thehistoryfeature can't disturb another consumer ✓Design / correctness
The two-collection split in
ReplStateis the right call and is documented well:history= rendered transcript (dups/failures preserved for display),store= deduped navigation ring. Moving thek/j-at-boundary logic into vim-line (and deleting the host'shandle_normal_jkshim +text_utils::floor_char_boundary) is a real simplification, and the boundary helpers are correct:is_on_first_line/is_on_last_lineslice with the raw bytecursor, which is safe becausevim.rs:115normalizes the incoming cursor to a char boundary at the public entry point, and every existing motion already relies on that invariant. The new helpers are even more defensive (.min(text.len())). Not a regression.prevnever returnsRecall::Draft, sohistory_upmatching onlyEntryis correct;history_downcorrectly handlesEntry/Draft/None. Draft-stash semantics are covered by tests.j/kstaying motion-only, and arrows being mode-independent history nav, are both explicitly tested.Minor observations (non-blocking)
save_historycontent semantics changed — from "last 1000 transcript lines (with duplicates)" to "dedupedstore.entries()". Intended and documented; the on-disk format (newline-delimited) is unchanged, so old history files still load. Flagging it as a user-visible change (the saved file is now deduped).Store::load(iter)is provided for hosts, but seqr seeds via per-lineadd_entry/push(because it must build the transcript in parallel). Justified;Store::loadis currently exercised only by tests here and will earn its keep whenplgrmigrates. Fine to keep as published API.Actionvariants (HistorySearch/HistoryAccept/HistoryCancel) aren't emitted yet — the exhaustive no-op match arm inapp.rsis the right way to reserve the vocabulary without dead-code churn.Nicely done — the design doc, the purity discipline, and the migration-as-proof framing are all solid.