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

[Upstream] Setting Normal highlight using nvim_set_hl is buggy #386

Closed
q107580018 opened this issue Apr 20, 2022 · 12 comments
Closed

[Upstream] Setting Normal highlight using nvim_set_hl is buggy #386

q107580018 opened this issue Apr 20, 2022 · 12 comments
Labels
bug Something isn't working upstream

Comments

@q107580018
Copy link

q107580018 commented Apr 20, 2022

What happened?

today,I update the latest version, I found the color of the separator is weird
Xnip2022-04-20_13-52-04

What did you expect to happen?

Make the color of the separator the same as the background color

Additional Information

OS:MacOS
Terminal:iterm2 + Tmux

commit

No response

@q107580018 q107580018 added the bug Something isn't working label Apr 20, 2022
@akinsho
Copy link
Owner

akinsho commented Apr 20, 2022

@q107580018 this issue does not provide any information at all that I could use to help you debug this issue. I don't know what theme you are using or what version of this plugin you are using or what branch. Please provide more information or I'll have to close this issue.

@q107580018
Copy link
Author

q107580018 commented Apr 20, 2022

@akinsho
OS: Ubuntu 20.04.4 LTS x86_64
Not Use Colors Theme
Vim version: NVIM v0.8.0-dev
Bufferline version:4917220 latest

init.vim
call plug#begin('~/.config/nvim/plugged')
Plug 'kyazdani42/nvim-web-devicons' " for file icons
Plug 'akinsho/bufferline.nvim'
call plug#end()
set hidden
set nu
set cursorline
set termguicolors
set hls
set background=dark
lua << END
require('bufferline').setup{
options = {
separator_style = "slant",
}

}
END

@akinsho
Copy link
Owner

akinsho commented Apr 20, 2022

Not Use Colors Theme

@q107580018 this plugin, especially the slant variant will not look good if you are not using a color scheme. The default color scheme basically lacks most of the essential highlight groups for this plugin. One of the key ones is Normal if you check :highlight Normal you will see it has no colour. There is nothing this plugin can do if no colors are specified.

Please either set a normal colour yourself or choose a color scheme that does this

@akinsho akinsho changed the title My bufferline background is not right, I don't know where the settings are wrong, the color of the separator is weird[Bug]: [Question] Default colorscheme does not work with slant separator style Apr 20, 2022
@q107580018
Copy link
Author

@akinsho
when I use 'ellisonleao/gruvbox.nvim' this color scheme, It also not look good . But It still look good before I update the lastest bufferline version.

@akinsho
Copy link
Owner

akinsho commented Apr 20, 2022

@q107580018 can you please clarify what "not good" means with a screenshot, since I don't know what you mean. Also, can you try setting config.options.themable = false to see if that changes anything

@q107580018
Copy link
Author

q107580018 commented Apr 20, 2022

@akinsho
config.options.themable = false is not useful.
this is not good
Xnip2022-04-20_19-41-36

this is good
CF6DF58153735CE880B32C39BC221655

The main difference is that the normal background color of the bufferline and the color of the separator are all black. Now the background color of the bufferline has become the same color as the vim theme, and the color of the separator has become the same color as the characters.

@akinsho
Copy link
Owner

akinsho commented Apr 20, 2022

@q107580018 so this change does not appear to be due to something in this plugin, I believe. I had a look at the code in @ellisonleao's theme (which is really nicely organized) and I believe it is due to a bug in neovim core
#320 (comment)
Basically @ellisonleao's plugin sets the Normal bg using nvim_set_hl which is currently buggy when used to set the highlights for the Normal group specifically which is a necessary group for this plugin as it represents the background. When set via nvim_set_hl and queried via the api it returns an empty table.

Colorscheme authors should make a specific edge case for Normal and not set it via nvim_set_hl. Please try adding vim.cmd 'highlight Normal guibg=#color guifg=#color' before loading this plugin and retest. If that works, then please raise an issue on that repository

@q107580018
Copy link
Author

@akinsho It's really a color theme issue. I changed the theme and solved it, thanks!

@akinsho akinsho changed the title [Question] Default colorscheme does not work with slant separator style [Upstream] Setting Normal highlight using nvim_set_hl is buggy Apr 20, 2022
@akinsho akinsho pinned this issue Apr 20, 2022
@akinsho
Copy link
Owner

akinsho commented Apr 20, 2022

Closing this out but leaving it pinned for future reference

@akinsho akinsho closed this as completed Apr 20, 2022
@ellisonleao
Copy link
Contributor

Colorscheme authors should make a specific edge case for Normal and not set it via nvim_set_hl. Please try adding vim.cmd 'highlight Normal guibg=#color guifg=#color' before loading this plugin and retest. If that works, then please raise an issue on that repository

thanks for raising that issue @akinsho ! i will try to fix it on my side

@baodrate
Copy link

baodrate commented Jul 4, 2022

It seems this will possibly be fixed along with neovim/neovim#18980 in neovim/neovim@98e2da7

@akinsho
Copy link
Owner

akinsho commented Jul 4, 2022

Thanks @qubidt yes it was, forgot to unpin it

@akinsho akinsho unpinned this issue Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

4 participants