Skip to content

fix: always style floating window borders - #154

Draft
MindTooth wants to merge 2 commits into
masterfrom
fix/float-border
Draft

MindTooth wants to merge 2 commits into
masterfrom
fix/float-border

Conversation

@MindTooth

Copy link
Copy Markdown
Member

Summary

Always define FloatBorder with Srcery colors, independently of the optional g:srcery_normal_float background setting.

This keeps floating-window borders visually consistent with Srcery while preserving the existing opt-in behavior for changing NormalFloat itself.

Problem

Srcery currently defines both NormalFloat and FloatBorder only when:

let g:srcery_normal_float = 1

That couples two separate concerns:

  • NormalFloat controls the floating window background.
  • FloatBorder controls the border drawn around Neovim floating windows.

With the option left at its default value (0), Srcery does not define FloatBorder. Neovim therefore falls back to its runtime/default highlight linkage for the border. This can make floating documentation windows use a much brighter border than the surrounding Srcery UI.

The issue is particularly visible with vim-lsp on Neovim. Its hover/completion documentation uses nvim_open_win() with a border and remaps the float contents to Pmenu:

call nvim_win_set_option(s:winid, 'winhl', 'Normal:Pmenu,NormalNC:Pmenu')

The contents therefore follow Srcery's Pmenu styling, while the border still uses FloatBorder. If Srcery leaves FloatBorder undefined, the dialog ends up with a Srcery-colored body but a runtime-defined border that does not match it.

Neovim documents FloatBorder as the highlight used for floating-window borders by default.

Change

Move the existing Srcery FloatBorder definition outside the g:srcery_normal_float conditional:

call s:HL('FloatBorder', s:gray3, s:none)

if g:srcery_normal_float == 1
  call s:HL('NormalFloat', s:none, s:gray1)
endif

The colors themselves are unchanged:

  • border foreground: gray3 (#312f2c)
  • border background: transparent / NONE
  • optional float background: gray1 (#1c1b19)

The README is adjusted accordingly: g:srcery_normal_float now accurately describes only the optional floating-window background behavior.

Why keep NormalFloat optional?

Srcery intentionally made NormalFloat opt-in because different plugins make different assumptions about floating-window backgrounds. This PR preserves that behavior.

The border does not have the same compatibility concern. A floating window that asks Neovim to draw a border already expects a border highlight, and defining FloatBorder ensures it follows the active colorscheme instead of inheriting a potentially incompatible runtime default.

This also keeps the change narrowly scoped: it does not alter Pmenu, PmenuSel, vim-lsp, vim-airline, or any plugin-specific highlight groups.

Verification

Verified against:

  • current srcery-vim master
  • current vim-lsp implementation, which creates Neovim documentation floats with nvim_open_win(), maps the contents to Pmenu, and leaves the border to FloatBorder
  • current Neovim documentation, which specifies FloatBorder as the default floating-window border highlight
  • existing Srcery history around NormalFloat, including the intentional opt-in added to avoid imposing a float background on every plugin

The branch contains only the colorscheme change and the matching documentation correction.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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