helix-mods/helix-core
Pascal Kuthe 4c7cdb8fea
Improve line annotation API
The line annotation as implemented in #5420 had two shortcomings:
* It required the height of virtual text lines to be known ahead time
* It checked for line anchors at every grapheme

The first problem made the API impractical to use in practice because
almost all virtual text needs to be softwrapped. For example inline
diagnostics should be softwrapped to avoid cutting off the diagnostic
message (as no scrolling is possible). While more complex virtual text
like side by side diffs must dynamically calculate the number of empty
lines two align two documents (which requires taking account both
softwrap and virtual text). To address this, the API has been
refactored to use a trait.

The second issue caused some performance overhead and unnecessarily
complicated the `DocumentFormatter`. It was addressed by only calling
the trait mentioned above at line breaks (instead of always). This
allows offers additional flexibility to annotations as it offers
the flexibility to align lines (needed for side by side diffs).
2024-07-15 16:34:14 +02:00
..
src Improve line annotation API 2024-07-15 16:34:14 +02:00
tests Resolve new Clippy lints 2024-05-07 15:15:52 -04:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml Convert LSP URIs into custom URIs 2024-07-15 09:31:33 -04:00