romgrk / barbar.nvim

The neovim tabline plugin.
2.16k stars 81 forks source link

Redundant left inactive separator at the end of buffer list #505

Closed mphe closed 1 year ago

mphe commented 1 year ago

Description

I'm using this plugin with a solarized colorscheme. I had to manually redefine some highlights, because the defaults weren't good. Now I notice a stray left inactive buffer separator at the end of the buffer list. Here are some screenshots with different separators: screenshot20230529153738 screenshot20230529153752 It also happens with the existing presets. The following is with the "powerline" preset (without further adapting highlights) screenshot20230529153826

Here is another screenshot with :highlight BufferInactiveSign guifg=#ff0000, showing more clearly that there is a left inactive buffer separator at the end. screenshot20230529153956

There are no other buffers that could interfere.

:buffers
  1 %a   "foo"                          line 1
  2      "bar"                          line 0

To Reproduce

Highlights:

autocmd VimEnter * call s:ApplyBarBar()
autocmd ColorScheme * call s:ApplyBarBar()

function s:ApplyBarBar()
    let current_bg = '#073642'
    let current_fg = '#C6C6C6'
    let visible_bg = current_bg
    let visible_fg = '#839496'
    let inactive_bg = '#094655'
    let inactive_fg = visible_fg
    let bufferline_bg = '#002b36'

    exec 'highlight BufferCurrent           guibg=' . current_bg  . ' guifg=' . current_fg
    exec 'highlight BufferCurrentMod        guibg=' . current_bg
    exec 'highlight BufferCurrentSign       guibg=' . current_bg  . ' guifg=' . bufferline_bg
    exec 'highlight BufferCurrentSignRight  guibg=' . current_bg  . ' guifg=' . bufferline_bg
    exec 'highlight BufferInactive          guibg=' . inactive_bg . ' guifg=' . inactive_fg
    exec 'highlight BufferInactiveSign      guibg=' . inactive_bg . ' guifg=' . bufferline_bg
    exec 'highlight BufferInactiveSignRight guibg=' . inactive_bg . ' guifg=' . bufferline_bg
    exec 'highlight BufferInactiveMod       guibg=' . inactive_bg
    exec 'highlight BufferVisible           guibg=' . visible_bg  . ' guifg=' . visible_fg
    exec 'highlight BufferVisibleSign       guibg=' . visible_bg  . ' guifg=' . bufferline_bg
    exec 'highlight BufferVisibleMod        guibg=' . visible_bg
    exec 'highlight BufferTabpageFill       guibg=' . bufferline_bg . ' guifg=' . bufferline_bg
endfun

Config:

require'bufferline'.setup {
  animation = true,
  auto_hide = false,
  tabpages = true,
  clickable = true,
  focus_on_close = 'left',
  hide = {extensions = true, inactive = false},
  highlight_alternate = false,
  highlight_inactive_file_icons = false,
  highlight_visible = true,

  icons = {
    buffer_index = false,
    buffer_number = false,
    button = '',
    diagnostics = {
      [vim.diagnostic.severity.ERROR] = {enabled = false},
      [vim.diagnostic.severity.WARN] = {enabled = false},
      [vim.diagnostic.severity.INFO] = {enabled = false},
      [vim.diagnostic.severity.HINT] = {enabled = false},
    },
    filetype = {
      custom_colors = false,
      enabled = true,
    },

    modified = {button = '●'},
    pinned = {button = '車'},
    separator = {left = '', right = ' '},
    inactive = {separator = {left = '', right = ' '}, button = '×'},
  },
  insert_at_end = false,
  insert_at_start = false,
  maximum_padding = 2,
  minimum_padding = 1,
  maximum_length = 30,
  semantic_letters = true,
  letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
  no_name_title = nil,
}

Informations Neovim version: NVIM v0.8.2

Iron-E commented 1 year ago

Closing as duplicate of #66 (specifically https://github.com/romgrk/barbar.nvim/issues/66#issuecomment-1496476879). Feel free to comment there as well

(Happy to see the preset feature get some use btw!)