romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

feat: `sidebar_filetypes` #395

Closed Iron-E closed 1 year ago

Iron-E commented 1 year ago

Takes into account the position of the sidebar on the screen (i.e. left/right sidebar), as well as having multiple sidebars open (i.e. undotree and nvim-tree, or nvim-tree and symbols-outline).

Example config:

require'barbar'.setup {
  sidebar_filetypes = {
    NvimTree = true, -- default event and text
    ['neo-tree'] = {event = 'BufWipeout', text = 'neo-tree'}, -- custom event and text
  },
}

The diff will look better after merging #399.


Closes #391. Closes #407.

romgrk commented 1 year ago

Neat idea. Do we expect any breaking changes for set_offset? Would it play nice with sidebar_filetypes or are they mutually exclusive?

Iron-E commented 1 year ago

Do we expect any breaking changes for set_offset? Would it play nice with sidebar_filetypes or are they mutually exclusive?

sidebar_filetypes actually uses set_offset internally. The only change to set_offset was that it now accepts a 'left'|'right' arg at the final position, to control which side of the bufferline the offset appears on.

I wasn't planning on removing set_offset, just because I know there are a lot of users who use it in their configurations, and it could be useful to expose it just in case there's an edge case that sidebar_filetypes doesn't account for.

Iron-E commented 1 year ago

We can follow up on #421— right now this seems to work for the general case.