Skip to content

fix(buffer): guard ViewContext line_hl against neogit_disable_hunk_highlight#1904

Open
barrettruth wants to merge 1 commit intoNeogitOrg:masterfrom
barrettruth:fix/view-context-disable-hunk-highlight
Open

fix(buffer): guard ViewContext line_hl against neogit_disable_hunk_highlight#1904
barrettruth wants to merge 1 commit intoNeogitOrg:masterfrom
barrettruth:fix/view-context-disable-hunk-highlight

Conversation

@barrettruth
Copy link

Problem

When neogit_disable_hunk_highlight = true is set on a buffer (introduced
in #1897 for third-party plugin interop), the HunkLine renderer correctly
skips its own highlights — but the ViewContext decoration provider's
on_win callback was still applying NeogitDiffContextHighlight as
line_hl_group on every visible line in the cursor's section. Because
line_hl_group operates on a separate stacking layer, it overrides
third-party backgrounds (e.g. DiffsAdd/DiffsDelete from diffs.nvim)
regardless of extmark priority, making them invisible.

Solution

Check neogit_disable_hunk_highlight per-line inside the ViewContext loop.
When set, skip add_line_highlight for non-cursor lines. The cursor-line
indicator (NeogitDiffContextCursorHighlight) is preserved.

…ghlight

Problem: ViewContext on_win applied NeogitDiffContextHighlight as
line_hl_group on all lines in the cursor's section, overriding third-
party plugin backgrounds regardless of extmark priority.

Solution: skip the per-line highlight when neogit_disable_hunk_highlight
is set, preserving only the cursor-line indicator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant