Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Tabline hidden by interaction with scope.nvim #925

Open
1 task done
TommyCox opened this issue Jun 13, 2024 · 0 comments · May be fixed by #950
Open
1 task done

[Bug]: Tabline hidden by interaction with scope.nvim #925

TommyCox opened this issue Jun 13, 2024 · 0 comments · May be fixed by #950
Labels
bug Something isn't working

Comments

@TommyCox
Copy link

TommyCox commented Jun 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

While using scope.nvim for tab-scoped buffers and option always_show_bufferline = false, switching to a tab with one buffer hides the tabline.

What did you expect to happen?

BufferLine to stay/appear due to multiple tabs existing.

Config

LazyVim defaults + overrides.

LazyVim
{
  "akinsho/bufferline.nvim",
  event = "VeryLazy",
  keys = {
    { "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
    { "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
    { "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
    { "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
    { "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
    { "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
    { "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
    { "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
    { "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
    { "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
    { "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
  },
  opts = {
    options = {
      -- stylua: ignore
      close_command = function(n) LazyVim.ui.bufremove(n) end,
      -- stylua: ignore
      right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
      diagnostics = "nvim_lsp",
      always_show_bufferline = false,
      diagnostics_indicator = function(_, _, diag)
        local icons = require("lazyvim.config").icons.diagnostics
        local ret = (diag.error and icons.Error .. diag.error .. " " or "")
          .. (diag.warning and icons.Warn .. diag.warning or "")
        return vim.trim(ret)
      end,
      offsets = {
        {
          filetype = "neo-tree",
          text = "Neo-tree",
          highlight = "Directory",
          text_align = "left",
        },
      },
      ---@param opts bufferline.IconFetcherOpts
      get_element_icon = function(opts)
        return LazyVim.config.icons.ft[opts.filetype]
      end,
    },
  },
  config = function(_, opts)
    require("bufferline").setup(opts)
    -- Fix bufferline when restoring a session
    vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
      callback = function()
        vim.schedule(function()
          pcall(nvim_bufferline)
        end)
      end,
    })
  end,
}
Overrides
return {
	"akinsho/bufferline.nvim",
	dependencies = { { "tiagovla/scope.nvim", config = true } },
}

Additional Information

Overriding with always_show_bufferline = true does not seem to prevent the problem.

commit

99337f6 (v4.6.1)

@TommyCox TommyCox added the bug Something isn't working label Jun 13, 2024
@TommyCox TommyCox linked a pull request Jul 25, 2024 that will close this issue
TommyCox added a commit to TommyCox/bufferline.nvim that referenced this issue Jul 25, 2024
Change `toggle_bufferline()` fallback value for `vim.o.showtabline` from
0 (always hide tabline) to 1 (show tabline if multiple tabpages exist).
This should fix akinsho#925.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant