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] Buffer is not set as "listed" when edit with "buffer" command in second tab #14

Open
tuanbass opened this issue Aug 14, 2023 · 2 comments

Comments

@tuanbass
Copy link
Contributor

tuanbass commented Aug 14, 2023

Environment
Lazyvim (https://www.lazyvim.org/)

return {
  {
    -- asscociate buffer to tab
    "tiagovla/scope.nvim",
    lazy = false,
    config = function() require("scope").setup() end,
    keys = { { "<leader>fB", "<cmd>Telescope scope buffers<cr>", desc = "All buffers" } },
  },
  { "famiu/bufdelete.nvim" },
  {
    "akinsho/bufferline.nvim",
    opts = {
      options = {
        always_show_bufferline = true,
        numbers = function(opts) return string.format("%s", opts.id) end,
      }, -- always show tabs, event if there is only one tab
    },
  },
}

Reproduces:

  1. Open 2 buffers A and B. Get a buffer number (using ls)
  2. Create a new tab (using tabnew)
  3. in second tab, open buffer A which previously in tab1 using command buffer <bnumber>
  4. Buffer A openned in tab2, but not shown in bufferline, even with always_show_bufferline=true
  5. ls command in tab2 does not show buffer A.
@tuanbass
Copy link
Contributor Author

It could be fixed with a simple:

    vim.api.nvim_buf_set_option(0, "buflisted", true)

But I dont know which event I should put the command.
Tried with BufAdd but it's seem have random behavior, sometime it works, sometime not (at least I didn't figure out the pattern)

@muhmud
Copy link

muhmud commented Dec 26, 2023

I am also having this issue.

It would be great if when you go to a buffer in a different tab, it would actually switch to that tab from the current one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants