Skip to content

No distinct highlight group for group headers in explorer #339

@thefapinstructor

Description

@thefapinstructor

Bug

The group headers in the explorer (e.g. Changes (18), Staged Changes (77)) use the Directory highlight group, which is the same group used for folder names. This makes them visually indistinguishable from directories.

Fix

Introduce a CodeDiffGroupHeader highlight group and use it for group-type nodes in prepare_node in lua/codediff/ui/explorer/nodes.lua:

if data.type == "group" then
  line:append(" ", "CodeDiffGroupHeader")
  line:append(node.text, "CodeDiffGroupHeader")

And define the highlight in lua/codediff/ui/highlights.lua:

vim.api.nvim_set_hl(0, "CodeDiffGroupHeader", { link = "Title", default = true })

This allows users to customize the group header appearance independently from folder names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions