Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating windows decoration highlighting problem #101

Open
fragov opened this issue Apr 28, 2022 · 5 comments
Open

Floating windows decoration highlighting problem #101

fragov opened this issue Apr 28, 2022 · 5 comments

Comments

@fragov
Copy link

fragov commented Apr 28, 2022

Some floating windows (probably those, who use NormalFloat highlight) have black borders on black background:
Capto_Capture 2022-04-28_12-12-24_PM

You may see same problem on your screenshot, where you have used TSHighlightCapturesUnderCursor
image

@cocopon
Copy link
Owner

cocopon commented Apr 28, 2022

Do you know what the border is? I mainly use Vim and don't know much about it.

@fragov
Copy link
Author

fragov commented Apr 29, 2022

Window on screenshot is created by https://github.com/stevearc/dressing.nvim plugin.
It has winhighlight option in config. I did found in source code of it next message: Set winhighlight="NormalFloat:MyHighlightGroup" instead, so I believe it is "NormalFloat".
They use this component for window: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/input
It has such code in config:

win_options = {
    winhighlight = "Normal:Normal",
  },

@cocopon
Copy link
Owner

cocopon commented May 1, 2022

NormalFloat is for background of the floating window. According to my research, FloatBorder is appropriate for this case.

image

I'll add color definitions around it, please wait...

@hori-ryota
Copy link

any updates? 🙇

@lambdalisue
Copy link
Contributor

lambdalisue commented Nov 19, 2024

This is a workaround, but we can link FloatNormal and FloatBorder to Normal and Delimiter as follows:

" NOTE: This must be defined PRIOR to setting the colorscheme.
if has('nvim')
  function! s:fix_iceberg_border() abort
    highlight link FloatNormal Normal
    highlight link FloatBorder Delimiter
  endfunction
  augroup my_iceberg_fix
    autocmd!
    autocmd ColorScheme iceberg call s:fix_iceberg_border()
  augroup END
endif

The above configuration makes the floating window appear as follows:

CleanShot 2024-11-19 at 15 15 04

CleanShot 2024-11-19 at 15 14 36

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

No branches or pull requests

4 participants