Skip to content

fix: always style floating window borders - #154

Merged
MindTooth merged 2 commits into
masterfrom
fix/float-border
Oct 27, 2026
Merged

MindTooth merged 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

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 06fcfec8-583e-48cd-940f-8ccbaa7848ee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@MindTooth
MindTooth marked this pull request as ready for review October 27, 2026 08:58
@MindTooth
MindTooth merged commit a0cd1b2 into master Oct 27, 2026
2 checks passed
@MindTooth
MindTooth deleted the fix/float-border branch November 16, 2026 00:37
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