akinsho / akinsho/bufferline.nvim
[Bug]: separator_visible is not used from the highlights for custom separator style
- Langage dominant
- Lua
- Étoiles
- 4.4k
- Forks
- 240
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### Is there an existing issue for this?
Yes, but it was closed. https://github.com/akinsho/bufferline.nvim/issues/859
I understand that you do not want to provide full flexibility, however what is provided in the plugin should work consistently. The option with custom separators in `separator_style` is only about taking in left and right characters, the coloring of them should be the same as standard options like "slant".
I am open to creating a PR for this.
- [X] I have searched the existing issues
### What happened?
When configuring highlights `separator_visible` has no effect on separators set using `separator_style = {'', ''}`. I did not find any reference to that parameter in the code when using individual separators.
### What did you expect to happen?
Plugin should respect `visible`, `selected` for custom separators the same way it does for standard separator styles.
### Config
I am using LazyVim to load the plugin.
```
-- Customize the entire bufferline theme from catppuccin
local function getHighlights()
local C = require("catppuccin.palettes").get_palette("macchiato")
local O = require("catppuccin").options
local transparent_background = O.transparent_background
local active_bg = transparent_background and "NONE" or C.crust
local inactive_bg = transparent_background and "NONE" or C.base
local separator_fg = O.transparent_background or C.crust
local inactive_fg = C.surface2
local styles = { "bold", "italic" }
return {
-- buffers
background = { bg = inactive_bg, fg = inactive_fg },
buffer_visible = { fg = inactive_fg, bg = inactive_bg },
buffer_selected = { fg = C.text, bg = active_bg, bold = true, italic = true },
-- Duplicate
duplicate_selected = { fg = C.text, bg = active_bg, bold = true, italic = true },
duplicate_visible = { fg = C.surface1, bg = inactive_bg, bold = true, italic = true },
duplicate = { fg = C.surface1, bg = inactive_bg, bold = true, italic = true },
-- tabs
tab = { fg = C.surface2, bg = inactive_bg },
tab_selected = { fg = C.sky, bg = C.surface1, bold = true, italic = true },
tab_separator = { fg = separator_fg, bg = inactive_bg },
tab_separator_selected = { fg = C.surface1, bg = C.surface1 },
tab_close = { fg = C.red, bg = inactive_bg },
indicator_visible = { fg = C.peach, bg = inactive_bg, bold = true, italic = true },
indicator_selected = { fg = C.peach, bg = active_bg, bold = true, italic = true },
-- separators
separator = { fg = C.red, bg = inactive_bg },
separator_visible = { fg = inactive_bg, bg = inactive_bg },
separator_selected = { fg = inactive_bg, bg = active_bg },
offset_separator = { fg = C.red, bg = inactive_bg },
-- close buttons
close_button = { fg = C.surface1, bg = inactive_bg },
close_button_visible = { fg = C.surface1, bg = inactive_bg },
close_button_selected = { fg = C.red, bg = active_bg },
-- Empty fill
fill = { bg = inactive_bg },
-- Numbers
numbers = { fg = C.subtext0, bg = inactive_bg },
numbers_visible = { fg = C.subtext0, bg = inactive_bg },
numbers_selected = { fg = C.subtext0, bg = active_bg, bold = true, italic = true },
-- Errors
error = { fg = inactive_fg, bg = inactive_bg },
error_visible = { fg = inactive_fg, bg = inactive_bg },
error_selected = { fg = C.red, bg = active_bg, bold = true, italic = true },
error_diagnostic = { fg = inactive_fg, bg = inactive_bg },
error_diagnostic_visible = { fg = inactive_fg, bg = inactive_bg },
error_diagnostic_selected = { fg = C.red, bg = active_bg },
-- Warnings
warning = { fg = inactive_fg, bg = inactive_bg },
warning_visible = { fg = inactive_fg, bg = inactive_bg },
warning_selected = { fg = C.yellow, bg = active_bg, bold = true, italic = true },
warning_diagnostic = { fg = inactive_fg, bg = inactive_bg },
warning_diagnostic_visible = { fg = inactive_fg, bg = inactive_bg },
warning_diagnostic_selected = { fg = C.yellow, bg = active_bg },
-- Infos
info = { fg = inactive_fg, bg = inactive_bg },
info_visible = { fg = inactive_fg, bg = inactive_bg },
info_selected = { fg = C.sky, bg = active_bg, bold = true, italic = true },
info_diagnostic = { fg = inactive_fg, bg = inactive_bg },
info_diagnostic_visible = { fg = inactive_fg, bg = inactive_bg },
info_diagnostic_selected = { fg = C.sky, bg = active_bg },
-- Hint
hint = { fg = inactive_fg, bg = inactive_bg },
hint_visible = { fg = inactive_fg, bg = inactive_bg },
hint_selected = { fg = C.teal, bg = active_bg, bold = true, italic = true },
hint_diagnostic = { fg = inactive_fg, bg = inactive_bg },
hint_diagnostic_visible = { fg = inactive_fg, bg = inactive_bg },
hint_diagnostic_selected = { fg = C.teal, bg = active_bg },
-- Diagnostics
diagnostic = { fg = inactive_fg, bg = inactive_bg },
diagnostic_visible = { fg = inactive_fg, bg = inactive_bg },
diagnostic_selected = { fg = C.subtext0, bg = active_bg, style = styles },
-- Modified
modified = { fg = C.peach, bg = inactive_bg },
modified_visible = { fg = C.peach, bg = inactive_bg },
modified_selected = { fg = C.peach, bg = active_bg },
}
end
return {
"akinsho/bufferline.nvim",
event = "VeryLazy",
dependencies = {
"catppuccin/nvim",
},
keys = {
{ "", "BufferLineCycleNext", desc = "Next tab" },
{ "", "BufferLineCyclePrev", desc = "Prev tab" },
},
opts = {
options = {
themable = true,
always_show_bufferline = true,
-- show_buffer_close_icons = true,
show_close_icon = false,
-- numbers = function(opts)
-- return string.format("%s", opts.raise(opts.ordinal))
-- end,
indicator = {
style = "underline",
},
-- This does not work due to a bug, will wait or fix this later
separator_style = { "", "" },
-- separator_style = "slant",
offsets = {
{
filetype = "neo-tree",
text_align = "left",
text = "Explorer",
},
},
},
highlights = getHighlights(),
},
}
```
### Additional Information
...
### commit
Checked the main branch
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.