Summary #
src/cursed/buffer.lua:delete_char early-returns only (line, col) when a replacement-text span is removed, breaking batch_edit's multi-value contract.
The Problem #
When delete_char removes a span and returns early, it returns exactly two values line, col. However, the caller batch_edit expects up to 7 values: (sl, sc, rl, rc, kind, e1, e2). The missing kind (and possibly missing e1,e2) causes the translator logic to skip cursor adjustment for subsequent cursors in the same batch. This can leave other cursors in incorrect positions when a delete that would have crossed a span is skipped.
Impact #
- correctness: Multicursor deletes where one cursor is on a replacement-text span may leave other cursors at stale coordinates after batch_edit.
Recommended Fix #
Make the early return match the full contract: return (line, col, line, col, "delete", line, col) to signal a zero-length delete (no buffer change) so batch_edit processes it correctly.
References #
757d8a9f..757d8a9f