Expand description
Source byte → display column, in one place.
Three carriers hold the same two tables — CellRow (the cell
path), DisplayLine (the display path), and the GPU peer’s
per-row arrays — and every one of them has to answer the same
question: given a source position, which column is it under?
Before conceal there was one term in that answer (inlay splices) and three copies of a four-line loop, which was survivable. With a second term the copies stop being survivable: an elision the cursor agrees with and the search highlight does not is a caret sitting off its own match, and the bug lives in whichever copy was not updated. So the arithmetic lands here once and the carriers delegate.
Design anchor:
docs/dev/architecture/conceal.md.
Functions§
- display_
col_ to_ source_ byte - Map a display column back to the source position under it — the
inverse of
source_byte_to_display_col, and what a mouse click needs. - source_
byte_ to_ display_ col - Map a source byte to its display column.
- subtract_
conceals - Remove the concealed columns lying before
source_colfrom an otherwise-computed display column.
Type Aliases§
- Conceal
Range - A concealed source-byte range,
[start, end).