sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

Wrong color of float win border #141

Closed XXiaoA closed 2 years ago

XXiaoA commented 2 years ago

I have done the following steps before reporting this issue:

Operating system/version

Ubuntu 22.04

Terminal emulator/version

Wezterm

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix

NVIM v0.8.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -ffile-prefix-map=/build/neovim-Ch6Bi
n/neovim-0.8.0~ubuntu1+git202209052347-fb39bba5a-c99271b19=. -flto=au
to -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-s
trong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_S
OURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2
 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-pro
totypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing
-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-
fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-
color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGP
ACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/
neovim-Ch6Bin/neovim-0.8.0~ubuntu1+git202209052347-fb39bba5a-c99271b1
9/build/cmake.config -I/build/neovim-Ch6Bin/neovim-0.8.0~ubuntu1+git2
02209052347-fb39bba5a-c99271b19/src -I/build/neovim-Ch6Bin/neovim-0.8
.0~ubuntu1+git202209052347-fb39bba5a-c99271b19/.deps/usr/include -I/u
sr/include -I/build/neovim-Ch6Bin/neovim-0.8.0~ubuntu1+git20220905234
7-fb39bba5a-c99271b19/build/src/nvim/auto -I/build/neovim-Ch6Bin/neov
im-0.8.0~ubuntu1+git202209052347-fb39bba5a-c99271b19/build/include
Compiled by buildd@lcy02-amd64-037

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Minimal vimrc that can reproduce this bug.

use gruvbox_material without other configuration

Steps to reproduce this bug using minimal vimrc

run :lua vim.ui.input({}, function() end) in neovim

Expected behavior

a float win wich a normal border

Screenshot_20220906_135514

Actual behavior

Screenshot_20220906_135444 something wrong of border. the color around border should be same as background

antoineco commented 2 years ago

@XXiaoA what plugin is that? On the latest Neovim nightly (v0.8.0-dev-1029-g05893aea3), :lua vim.ui.input({}, function() end) doesn't open such popup. The input is in the command line bar, at the bottom:

image image

XXiaoA commented 2 years ago

Sorry, I forgot I installed dressing.nvim. But it used the standard highlight groups for neovim floating windows. See here.

antoineco commented 2 years ago

OK thanks for double checking 👍

Maybe @sainnhe can confirm, but to me it seems like a conscious design decision for this theme:

image

Removing specific background styling makes the popup blend in, but as a result it also doesn't stand out from the main window:

image

The image (purple theme) you shared earlier does set the border background to the same color as the default background, but not in the center, so the result looks glitchy:

image

Adopting this style in Gruvbox Material looks equally glitchy in my opinion:

image

Out of these 3 variants, I personally find the current style the most readable while working with floating popups.


For the time being, my suggestion would be to apply local customisations using autocmd to tailor the look and feel of floating popups to your needs:

:page_facing_up: .vimrc (Vim)

```vim " Apply custom highlights on colorscheme change. " Must be declared before executing ':colorscheme'. augroup custom_highlights_gruvboxmaterial autocmd! " floating popups autocmd ColorScheme gruvbox-material \ hi NormalFloat guibg=#282828 | \ hi FloatBorder guibg=#282828 augroup END colorscheme gruvbox-material ```

:page_facing_up: init.lua (Neovim)

```lua -- Apply custom highlights on colorscheme change. -- Must be declared before executing ':colorscheme'. grpid = vim.api.nvim_create_augroup('custom_highlights_gruvboxmaterial', {}) vim.api.nvim_create_autocmd('ColorScheme', { group = grpid, pattern = 'gruvbox-material', command = -- floating popups 'hi NormalFloat guibg=#282828 |' .. 'hi FloatBorder guibg=#282828' }) vim.cmd'colorscheme gruvbox-material' ```
XXiaoA commented 2 years ago

Okay, it does maybe a design for this colorscheme. I'll try use autocmd to configure it.

MohammadLashkari commented 6 months ago

Hi, the autocmd works perfectly, thanks. I just want to report that for the autocompletion panel with borders, it has the same behavior. Also, in the Harpoon pop-up panel, if you go to visual mode, you can't see the text selection area; the colors are the same.

1 2