refactor: keep gitsigns popup integration out of highlight internals #149

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

Original issue: barrettruth/diffs.nvim#344
Original author: barrettruth
Original date: 2026-05-13T17:34:20Z

Tracked By

Context

This is pre-v0.4.0 cleanup that should land on main before the hard-removal branch. Current main still keeps fixed highlight priorities in normalized config while user-provided priority values are deprecated.

Problem

lua/diffs/gitsigns.lua both adapts popup text into hunks and writes extra prefix extmarks after highlight_hunk(), including direct access to opts.highlights.priorities.syntax.

That exposes a renderer detail to the gitsigns integration.

Scope

Keep gitsigns.lua as a thin popup adapter. Move prefix-extmark rendering behind a highlight/runtime helper, or otherwise route it through a shared hunk option/rendering helper so gitsigns does not reach into priority fields directly.

Acceptance Criteria

  • lua/diffs/gitsigns.lua has no direct opts.highlights.priorities access
  • popup hunk parsing fixtures still pass
  • popup namespace clearing is unchanged
  • visible diff highlighting in gitsigns popups is unchanged
  • current v0.3.x config priority behavior is unchanged

Suggested Verification

direnv exec . busted spec/gitsigns_spec.lua spec/highlight_spec.lua spec/config_spec.lua
> Original issue: barrettruth/diffs.nvim#344 > Original author: `barrettruth` > Original date: 2026-05-13T17:34:20Z ## Tracked By - #315 ## Context This is pre-v0.4.0 cleanup that should land on `main` before the hard-removal branch. Current `main` still keeps fixed highlight priorities in normalized config while user-provided priority values are deprecated. ## Problem `lua/diffs/gitsigns.lua` both adapts popup text into hunks and writes extra prefix extmarks after `highlight_hunk()`, including direct access to `opts.highlights.priorities.syntax`. That exposes a renderer detail to the gitsigns integration. ## Scope Keep `gitsigns.lua` as a thin popup adapter. Move prefix-extmark rendering behind a highlight/runtime helper, or otherwise route it through a shared hunk option/rendering helper so gitsigns does not reach into priority fields directly. ## Acceptance Criteria - `lua/diffs/gitsigns.lua` has no direct `opts.highlights.priorities` access - popup hunk parsing fixtures still pass - popup namespace clearing is unchanged - visible diff highlighting in gitsigns popups is unchanged - current v0.3.x config priority behavior is unchanged ## Suggested Verification ```sh direnv exec . busted spec/gitsigns_spec.lua spec/highlight_spec.lua spec/config_spec.lua ```
barrettruth 2026-09-21 18:12:33 +00:00
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#149
No description provided.