scope.nvim icon indicating copy to clipboard operation
scope.nvim copied to clipboard

Buffer appears unlisted if I do `:tab sb`

Open ajitid opened this issue 2 years ago • 8 comments

Steps to reproduce:

  • Try to move/copy over a buffer to a new tab using :tab sb or <c-w>T
  • Do :ls. You won't see the buffer as it is unlisted
  • Do :setlocal buflisted followed by :ls. You would now see the buffer appearing in the buffer list.

ajitid avatar Jun 26 '22 12:06 ajitid

I think I tried to call vim.api.nvim_buf_set_option(0, "buflisted", true) on TabEnter but it was not quite working. I will check it again.

tiagovla avatar Jun 26 '22 15:06 tiagovla

@ajitid could you check if this fixed it?

tiagovla avatar Jun 27 '22 00:06 tiagovla

Seems like this fixed it, but this also created a new problem. To reproduce:

  • Open a file
  • Do :tabnew
  • Do :ls
  • Even though this is a new tab you would see the buffer in your previous tab as your alternate buffer here

ajitid avatar Jun 27 '22 01:06 ajitid

I noticed it. I think the problem is that the TabEvents happen before BufEnter. I'm trying to fix this without introducing custom commands.

tiagovla avatar Jun 27 '22 01:06 tiagovla

I think it now works with :tabnew and <c-w>T. It still doesn't work with :tab sb, I think it's an upstream issue, it doesn't trigger the TabNewEntered event. They fixed <c-w>T https://github.com/neovim/neovim/issues/4979 a while ago.

EDIT: here's the issue https://github.com/neovim/neovim/issues/4334

tiagovla avatar Jun 27 '22 02:06 tiagovla

Yep, I've subscribed to that issue. Let's keep this open until upstream is resolved.

ajitid avatar Jun 27 '22 03:06 ajitid

I think it now works with :tabnew and <c-w>T. It still doesn't work with :tab sb, I think it's an upstream issue, it doesn't trigger the TabNewEntered event. They fixed <c-w>T neovim/neovim#4979 a while ago.

EDIT: here's the issue neovim/neovim#4334

The neovim issue you mentioned has been fixed. I haven't checked if it fixes this ticket as well.

ajitid avatar Oct 08 '23 04:10 ajitid

Seems like this fixed it, but this also created a new problem. To reproduce:

  • Open a file
  • Do :tabnew
  • Do :ls
  • Even though this is a new tab you would see the buffer in your previous tab as your alternate buffer here

Just checked, this isn't fixed.

ajitid avatar Dec 22 '23 11:12 ajitid