Skip to content

Keep panes see-through on transparent colorschemes - #19

Merged
CoreyKaylor merged 2 commits into
mainfrom
transparent-background
Nov 4, 2026
Merged

CoreyKaylor merged 2 commits into
mainfrom
transparent-background

Conversation

@CoreyKaylor

Copy link
Copy Markdown
Owner

Fixes #18.

Problem

When Normal has no background (a transparent theme), highlights.lua fell back to #000000 for two separate jobs:

  1. Painting. Context rows, gutters, splits, filler, the sign column and the panel/status strips painted solid black (or a tint of it) over the terminal.
  2. Blending. Every derived colour (bands, change emphasis, split and status tints) was mixed against black, even on light terminals.

Fix

resolve_backgrounds splits that fallback into two values:

  • Reference background (blending): ui.theme.background (hex or a colour name) → Normal.bg → a neutral #1E1E1E / #FFFFFF picked by 'background'.
  • Painted background: NONE when Normal has no bg, otherwise the reference. ui.theme.transparent = true/false overrides detection.

Add/delete/change bands stay opaque. Transparent themes now work with no configuration; ui.theme.background only tunes the band blend to the terminal's exact colour.

Related changes:

  • Hidden separators (right pane ↔ overview strip) were hidden by fg = bg, which leaves a visible line when transparent. Those windows now get a window-local fillchars with a blank vert, keeping the user's other fillchars.
  • vim.opt.fillchars:append({ vert = "│" }) also reset the current window's local fillchars, so it's now vim.opt_global. The Kitty edge bridges read the glyph from the global value for the same reason.
  • The README documents ui.theme.background and ui.theme.transparent.

Tests

Suite 14 (tests/specs/10_connector.lua) covers:

  • a transparent Normal leaves every page and status group with no bg, while bands stay solid
  • background changes the blend without making the panes opaque, and colour names are accepted
  • transparent = false / true force each mode
  • a light-terminal fallback gives light bands
  • opaque themes are unchanged
  • hidden_separator_fillchars

The full suite passes (nvim --headless -u tests/run.lua → OK).

Not verified visually: Kitty ribbon anti-aliasing over a transparent terminal background.

With no Normal background, highlights fell back to #000000 and painted it
opaquely over the context rows, gutters, splits and panels, and blended
every band against black. Split that value in two:

- a reference background for blending: ui.theme.background (hex or a
  colour name), then Normal.bg, then a neutral dark/light fallback chosen
  by 'background';
- the painted page background: NONE when Normal has no bg (or
  ui.theme.transparent = true), otherwise the reference.

Add/delete/change bands stay opaque. Hidden separators get a blank
window-local vert fillchar, since fg = bg no longer hides the glyph, and
the global vert append uses vim.opt_global so it stops resetting the
current window's local fillchars.

Fixes #18
Overview strips now blank their separator glyph instead of colouring it
fg = bg, so the integration verifier's separator count no longer includes
them. The visible separators are the same with or without overviews.
@CoreyKaylor
CoreyKaylor merged commit 81655b6 into main Nov 4, 2026
1 check passed
@CoreyKaylor
CoreyKaylor deleted the transparent-background branch November 4, 2026 20:52
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.

Everything is black and gray with transparent background

1 participant