nanozuki/tabby.nvim

Not compatible: require('tabby.feature.buf_name').get()

Closed this issue · 1 comments

It is probably because I have a very old config (simplified version below). It seems I was using require('tabby.feature.buf_name').get() with the current window id, which apparently used to work, but does not anymore.

Replacing cur_win with vim.fn.winbufnr(cur_win) does give me the correct filename, but strangely, it gives the current path for unnamed buffers instead of [No Name].

local function name_fallback(tabid)
  local cur_win = require('tabby.module.api').get_tab_current_win(tabid)
  if require('tabby.module.api').is_float_win(cur_win) then
    return '[Floating]'
  else
    return require('tabby.feature.buf_name').get(cur_win)
  end
end

require('tabby.tabline').set(
  function(line)
    ...
  end,
  {
    tab_name = {
      name_fallback = name_fallback
    },
  }
)

Originally posted by @mikaraunio in #160 (comment)

@mikaraunio I apologize for introducing this compatibility issue when adding the buffers family of features, it is now fixed in the latest commit.