akinsho / bufferline.nvim

A snazzy bufferline for Neovim
GNU General Public License v3.0
3.3k stars 193 forks source link

Announcements and Breaking Changes #387

Open akinsho opened 2 years ago

akinsho commented 2 years ago

Hi 👋🏾,

If you want to know ahead of time about any changes or breakage, please subscribe to this issue. Generally I will now do all development on the dev branch which is unstable, so I have the freedom to try new things and develop quickly there without worrying about disrupting users workflows. This plugin will also use tags and semver, so users can pin their installations to the latest major version e.g. tag = 1.* and only upgrade major version when they are ready to migrate.

I will announce anything of note on this thread, so users are aware in advance.

akinsho commented 2 years ago

Version 2.0.0 which is due to be merged in a few days, will change the required neovim version to 0.7.0 so this plugin can benefit from all the api changes and remove the ~hacks~/workarounds for autocommands and user commands etc. that it has been using.

Any user wanting to stay on the pre 0.7.0 version of this plugin should use the v1.* tag e.g.

use {'akinsho/bufferline.nvim', tag = 'v1.*' }
akinsho commented 1 year ago

option.indicator_icon has been soft deprecated. For anyone overriding the indicator_icon please update your config to

config = {
  options = {
    indicator = {
      style = 'icon',
      icon = '|',
    }
  }
}

This will eventually be removed in a month

akinsho commented 1 year ago

All highlighting must now be done using the same arguments as are used for nvim_set_hl i.e. all gui* attributes e.g. guifg, guibg etc. should now be changed as follows guifgforeground guibgbackground gui=italic,bold,underline{italic = true, underline = true, bold = true}

Please see :help nvim_set_hl for more details.

This removes an old piece of legacy code that was manually translating user gui attributes into the correct format once this plugin migrated to nvim_set_hl

This translation is scheduled for removal in 1 month as well.

akinsho commented 1 year ago

I've now automated releasing bufferline versions so will be removing the dev branch eventually and no longer pushing to it. All development will now be on main and if people want stability they should stick with the tags which I've now setup to be autogenerated on version bumps

akinsho commented 1 year ago

I'v deprecated show_buffer_default_icon this field is only necessary for users who do not want to show a default icon bufferline includes a default icon for files without an icon by default. Any users who want to turn of the default can use the new get_element_icon field and use nvim-web-devicons themselves with their own preferences e.g.

options = {
    get_element_icon = function(element)
        return require('bufferline').get_element_icon(element.name, {default = true})
    end
}
akinsho commented 1 year ago

I've also changed the group.matcher argument to pass in less private/internal data e.g.

options = {
  groups = {
  options = { toggle_hidden_on_enter = true },
  items = {

    {
      name = 'Dependencies',
      icon = '',
      matcher = function(buf) -- buf here is now only a subset of the full buffer object
        return vim.startswith(buf.path, vim.env.VIMRUNTIME)
      end,
    },
}

This should not affect most people only anyone using one of the more obscure fields. If that was you please open an issue. If it's a very private field then we'll discuss if there's a way to replicate it and if not maybe it worth re-adding.

akinsho commented 1 year ago

Removed the old gui{fg,bg} translation layer, a lot later than the promised 1 month 👉🏿 https://github.com/akinsho/bufferline.nvim/issues/387#issuecomment-1226035817. Whilst not technically a breaking change as the earlier deprecation was marked as breaking. Just mentioning here for visibility. Using one of these values has long been validated against in the users config so hopefully people have all migrated off of this.