Namespaced conceal range-clear (ConcealManager::remove_in_range_for_namespace)#2399
Conversation
|
What's the observable bug that is fixed by "Deterministic virtual-line ordering" ? Did you encounter an issue while building the graphics pr? |
@sinelaw when I was viewing the markdown preview, scrolling vertically caused the pipe table borders in continuation rows to jump out of position. They would snap back into the correct position as I scrolled farther. Turns out the continuation lines for a wrapped row are virtual texts sharing the same anchor and priority. They live in a Fix is just adding |
|
Same here as in the other PR - I can't reproduce the scroll issue causing table borders to move. Can we change this PR to only add the ConcealManager stuff so I can merge it separately? |
|
By the way which OS / Platform / Terminal app are you using? |
I wonder if it is specific to my setup, I would think so |
I am using: PC: Mac Book Pro M1 |
…primitive Per @sinelaw's review on sinelaw#2399: pare this PR down to only the ConcealManager namespaced range-clear so it can be merged on its own. The deterministic VirtualTextId tiebreak in virtual_text.rs is removed here and will be revisited separately (the underlying scroll/flicker issue isn't reproducible on the maintainer's setup). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Yes, completed |
|
Needs rebase |
…ne order Two small, additive core primitives the markdown-compose work depends on, split out of the larger sinelaw#2325 so they can be reviewed and merged on their own. - `ConcealManager::remove_in_range_for_namespace()` — clear only one namespace's conceal ranges overlapping a byte range, leaving other plugins' conceals intact. Mirrors the existing `Overlay` equivalent (issue sinelaw#2146). Exposed to plugins as `editor.clearConcealsInRangeForNamespace(...)` via a new `PluginCommand::ClearConcealsInRangeForNamespace`. Lets a plugin rebuild its own conceals per line without stomping another plugin's. - `VirtualTextManager` query methods now break sort ties on a monotonic `VirtualTextId` (insertion order) after (position, priority). Virtual texts live in a HashMap with arbitrary iteration order, so equal-(position, priority) entries at one anchor — e.g. several stacked continuation rows of one wrapped table row — previously came back shuffled between frames. No graphics/kitty code here. Pure additions; existing behavior unchanged. Tests: namespace isolation + range/version semantics for the conceal clear; insertion-order determinism for same-anchor/same-priority virtual lines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…primitive Per @sinelaw's review on sinelaw#2399: pare this PR down to only the ConcealManager namespaced range-clear so it can be merged on its own. The deterministic VirtualTextId tiebreak in virtual_text.rs is removed here and will be revisited separately (the underlying scroll/flicker issue isn't reproducible on the maintainer's setup). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
01c3253 to
104f5a0
Compare
What this is
One small, additive core primitive, carved out of #2325 so it can be reviewed and merged on its own. No graphics / kitty-protocol code is in here.
ConcealManager::remove_in_range_for_namespace()Clears only one namespace's conceal ranges that overlap a byte range, leaving other plugins' conceals in that range untouched. This mirrors the existing
OverlayManager::remove_in_range_for_namespace(issue #2146) — conceals just never had the namespaced variant.It's exposed to plugins as
editor.clearConcealsInRangeForNamespace(bufferId, namespace, start, end)via a newPluginCommand::ClearConcealsInRangeForNamespace. This lets a plugin rebuild its own conceals for a line (the common per-linelines_changedrebuild pattern) without stomping conceals another plugin placed on the same line.Why it's split out like this
This is one of several PRs breaking up #2325, which I'm closing in favor of these smaller PRs.
This PR was originally scoped to also include a deterministic virtual-line ordering tiebreak in
virtual_text.rs. Per @sinelaw's request, that change has been removed so the ConcealManager primitive can be merged on its own. The underlying scroll/flicker issue it addressed isn't reproducible on the maintainer's setup, so it'll be revisited separately rather than holding up this merge.Risk
Low. The change is purely additive — the conceal method is brand new; nothing previously called it.
Tests
view::conceal::tests— namespace isolation (only the target namespace's in-range conceals are removed; other namespaces and out-of-range entries survive) plus range/version no-op semantics.Full local CI passes (
fmt,clippy,doc, schema,check --no-default-features, and the touched test modules). Thets_exportAPI-surface tests (incl. the generated.d.tsvalidation) pass with the new method.Supersedes #2325 (being closed). Follow-up PRs will cover the virtual-line ordering, the markdown-compose rendering, and, separately, the graphics/kitty work for review.