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

Buffer appears unlisted if I do :tab sb #2

Open
ajitid opened this issue Jun 26, 2022 · 8 comments
Open

Buffer appears unlisted if I do :tab sb #2

ajitid opened this issue Jun 26, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@ajitid
Copy link

ajitid commented Jun 26, 2022

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.
@tiagovla
Copy link
Owner

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
Copy link
Owner

@ajitid could you check if this fixed it?

@ajitid
Copy link
Author

ajitid commented Jun 27, 2022

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

@tiagovla
Copy link
Owner

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
Copy link
Owner

tiagovla commented Jun 27, 2022

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

@ajitid
Copy link
Author

ajitid commented Jun 27, 2022

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

@ajitid ajitid changed the title Buffer appears unlisted if I do :tab sb or <c-w>T Buffer appears unlisted if I do :tab sb ~or <c-w>T~ Jun 27, 2022
@ajitid ajitid changed the title Buffer appears unlisted if I do :tab sb ~or <c-w>T~ Buffer appears unlisted if I do :tab sb Jun 27, 2022
@tiagovla tiagovla added the bug Something isn't working label Jun 27, 2022
@ajitid
Copy link
Author

ajitid commented Oct 8, 2023

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
Copy link
Author

ajitid commented Dec 22, 2023

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.

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

No branches or pull requests

2 participants