Skip to content

Add per-depth header highlighting and refactor highlight group configuration#43

Merged
AntonVanAssche merged 1 commit into
AntonVanAssche:masterfrom
thecodewarrior:header-highlighting
Jun 19, 2026
Merged

Add per-depth header highlighting and refactor highlight group configuration#43
AntonVanAssche merged 1 commit into
AntonVanAssche:masterfrom
thecodewarrior:header-highlighting

Conversation

@thecodewarrior

Copy link
Copy Markdown
Contributor
  1. Adds a new key in highlight_groups for header highlights
  2. Extends the interpretation of highlight_groups values:
    • Allows specifying an existing highlight group by name
    • Expands the table to support specifying the full nvim_set_hl() value

This new highlight group interpretation includes one minor breaking change, which is that setting fg or bg to nil will no longer default to "NONE". In the past if both fg and bg were nil (the default state), the highlight group would simply be left uninitialized, so to maintain compatibility in this case the title, border, and text defaults have been changed to nil, which similarly falls back to an undefined group.

This implementation is currently dependent on #40, because as part of highlighting the header rows it needs to get the length of the indent, so it knows what column to start the highlighting. To do this is calls #get_indent(depth), which is a function defined in #40. If #40 is not merged this can be refactored to hard-code (depth - 1) * 2.

@AntonVanAssche

Copy link
Copy Markdown
Owner

Hi, #40 has been merged, please rebase your branch to include the indent option.

@AntonVanAssche

Copy link
Copy Markdown
Owner

Thanks!

@AntonVanAssche AntonVanAssche merged commit 9a4ec4f into AntonVanAssche:master Jun 19, 2026
4 checks passed
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.

2 participants