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]: error when there are no tabs to close with GroupClose #678

Closed
1 task done
otavioschwanck opened this issue Feb 15, 2023 · 4 comments · Fixed by #681
Closed
1 task done

[Bug]: error when there are no tabs to close with GroupClose #678

otavioschwanck opened this issue Feb 15, 2023 · 4 comments · Fixed by #681
Labels
bug Something isn't working

Comments

@otavioschwanck
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Error executing Lua callback: .../nvim/lazy/bufferline.nvim/lua/bufferline/utils/init.lua:110: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
	[C]: in function 'ipairs'
	.../nvim/lazy/bufferline.nvim/lua/bufferline/utils/init.lua:110: in function 'for_each'
	...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:304: in function 'command'
	...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:135: in function 'group_action'
	...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:247: in function <...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:247>
Error executing Lua callback: .../nvim/lazy/bufferline.nvim/lua/bufferline/utils/init.lua:110: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
	[C]: in function 'ipairs'
	.../nvim/lazy/bufferline.nvim/lua/bufferline/utils/init.lua:110: in function 'for_each'
	...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:304: in function 'command'
	...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:135: in function 'group_action'
	...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:247: in function <...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:247>

What did you expect to happen?

Should show a message: There is no buffer to close

Config

return {
  {
    "akinsho/bufferline.nvim",
    event = "VeryLazy",
    keys = {
      { "<leader>bp", "<Cmd>BufferLineTogglePin<CR>",            desc = "Toggle pin" },
      { "<leader>bk", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
      { "<leader>bn", ":e ~/.nvim-scratch<CR>",                  desc = "Open Scratch Buffer" },
      { "<C-s>",         "<cmd>BufferLineTogglePin<cr>",            desc = "Prev Buffer" },
      { "[b",         "<cmd>BufferLineCyclePrev<cr>",            desc = "Prev Buffer" },
      { "]b",         "<cmd>BufferLineCycleNext<cr>",            desc = "Next Buffer" },
      { "H",         "<cmd>BufferLineCyclePrev<cr>",            desc = "Prev Buffer" },
      { "L",         "<cmd>BufferLineCycleNext<cr>",            desc = "Next Buffer" },
      { "[B",         "<cmd>BufferLineMovePrev<cr>",             desc = "Switch Prev Buffer" },
      { "]B",         "<cmd>BufferLineMoveNext<cr>",             desc = "Switch Next Buffer" },
      { "<C-h>",         "<cmd>BufferLineMovePrev<cr>",             desc = "Switch Prev Buffer" },
      { "<C-l>",         "<cmd>BufferLineMoveNext<cr>",             desc = "Switch Next Buffer" },
    },
    opts = {
      options = {
        diagnostics = "nvim_lsp",
        always_show_bufferline = true,
        offsets = {
          {
            filetype = "neo-tree",
            text = "Neo-tree",
            highlight = "Directory",
            text_align = "left",
          },
        },
      },
    },
  }
}

Additional Information

,,,

commit

013857c12340bc14e285727eaf7d0bfb9807c768

@otavioschwanck otavioschwanck added the bug Something isn't working label Feb 15, 2023
@akinsho
Copy link
Owner

akinsho commented Feb 15, 2023

As mentioned in another issue, whilst I appreciate issues being raised. At this point it's much more valuable for me to have contributions as well since I really don't have a huge amount of time to spend across the dozens of open issues I have on multiple repos at this point. Contributions very much welcome (otherwise these issue will sit open for ages without any help)

@akinsho akinsho changed the title [Bug]: Erro when are no tabs to close with GroupClose [Bug]: error when are no tabs to close with GroupClose Feb 15, 2023
@otavioschwanck
Copy link
Contributor Author

i will fix it in the weekend!

@akinsho
Copy link
Owner

akinsho commented Feb 15, 2023

Also see issue raised in #679

@akinsho akinsho changed the title [Bug]: error when are no tabs to close with GroupClose [Bug]: error when there are no tabs to close with GroupClose Feb 15, 2023
@akinsho
Copy link
Owner

akinsho commented Feb 20, 2023

Should be fixed now

@akinsho akinsho closed this as completed Feb 20, 2023
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.

2 participants