bug: duplicate extmarks from two-pass rendering #65

Closed
opened 2026-09-21 18:11:55 +00:00 by barrettruth · 0 comments
Owner

Original issue: barrettruth/diffs.nvim#143
Original author: barrettruth
Original date: 2026-03-04T05:59:47Z

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.

> Original issue: barrettruth/diffs.nvim#143 > Original author: `barrettruth` > Original date: 2026-03-04T05:59:47Z ## 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.
barrettruth 2026-09-21 18:11:55 +00:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
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#65
No description provided.