Skip to main content

Crate strop_core

Crate strop_core 

Source
Expand description

strop-core: the buffer. A rope, byte-offset positions, edit ops. No UI, no modes, no grammar — the thing everything else edits.

Modules§

diagnostics
Mutation diagnostics at the mechanics boundary, including open undo groups.
editmap
The anchor-mapping kernel, verified (0045): map_position carries the proof of its contract in-tree; cargo verus verify checks it, and the normal build compiles the verus! block as plain Rust (ghost code erases). This is the production function editor/transact.rs calls — not a copy.
history
Undo history (Helix helix-core/history.rs lineage, ported): revisions form a tree — every committed transaction is a node holding both its undo and redo edit sets; u walks to the parent, Ctrl-r descends to the last-visited child. Editing after an undo forks a new branch; the tree keeps the old one (0001 pillar 4: Neovim users expect branches).
id
Stable identities and typed coordinates (0014 wave 2).
layout
The layout layer (0017, R6 in 0031): one line’s byte↔display-cell maps and grapheme boundaries. Every visible-line consumer — renderer, cursor placement, selection overlays, diagnostics, mouse hit-testing — reads this instead of deriving positions by char index.
path_serde
Versioned native path representation. No lossy round-trip can select a file.
process
Worker-only child ownership. Cancellation signals a private Unix process group promptly; only its owner may revoke the capability and reap the PID.
selection
One selection model for everything (0014 wave 2): normal mode is a collapsed selection, visual mode is a stretched one, multicursor is several. Cursor / anchor / extra-cursors used to be three fields that could disagree; the set owns them with the invariants in one place.
worker

Structs§

Buffer
A text buffer. Positions are UTF-8 byte offsets, everywhere (0001 §5.1).
BufferSeed
A pure, serializable image of a buffer at the startup seed boundary. The buffer’s diagnostic trace identity is deliberately absent: it names a process-local incarnation, not document semantics.
Change
HistoryMove
InputEdit
Pre-edit and post-edit geometry recorded at the instant text changes.
PreparedReplacements
Validated, sorted replacements bound to one exact buffer incarnation/revision. The editor may restore prompt selection state before acquiring its write lease.
Range
A half-open byte range [start, end) plus its vim shape. Fields are ByteOffset — the storage coordinate is typed end to end (0014).
Replacement
SaveReceipt
SaveRequest
SystemEdit
UserEdit

Enums§

ChangeOrigin
EditError
MotionShape
How vim thinks about a range (0014): charwise ops carry the motion’s inclusivity (dfx vs dtx differ by it); linewise is line-shaped. Blockwise lands with visual block — the enum is the extension point.