bug: duplicate extmarks from two-pass rendering #143

Closed
opened 2026-03-04 05:59:47 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-03-04 05:59:47 +00:00

Problem

The decoration provider's two-pass rendering (pass 1: line backgrounds + intra-line; pass 2: deferred treesitter) produces duplicate extmarks on some hunk lines. Observed in a debug dump of email_quote_demo.diff:

  • Line 30 (> + pass): two DiffsAdd extmarks, two DiffsAddNr, two DiffsAddText
  • Line 12 (+ pass): same duplication on the non-quoted equivalent

Both the quoted and non-quoted hunks exhibit this, so it's unrelated to email quote parsing — it's a pre-existing issue in the two-pass pipeline.

Pass 2 likely reapplies line backgrounds and intra-line diffs that pass 1 already set, without clearing pass 1's extmarks first (or clearing per-hunk ranges but missing some).

Impact

Functionally harmless (duplicate extmarks with same priority/hl_group are visually identical), but doubles the extmark count unnecessarily and could matter for large buffers with many hunks.

## Problem The decoration provider's two-pass rendering (pass 1: line backgrounds + intra-line; pass 2: deferred treesitter) produces duplicate extmarks on some hunk lines. Observed in a debug dump of `email_quote_demo.diff`: - Line 30 (`> + pass`): two `DiffsAdd` extmarks, two `DiffsAddNr`, two `DiffsAddText` - Line 12 (`+ pass`): same duplication on the non-quoted equivalent Both the quoted and non-quoted hunks exhibit this, so it's unrelated to email quote parsing — it's a pre-existing issue in the two-pass pipeline. Pass 2 likely reapplies line backgrounds and intra-line diffs that pass 1 already set, without clearing pass 1's extmarks first (or clearing per-hunk ranges but missing some). ## Impact Functionally harmless (duplicate extmarks with same priority/hl_group are visually identical), but doubles the extmark count unnecessarily and could matter for large buffers with many hunks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/diffs.nvim#143
No description provided.