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

fix(tabpages): renaming bug on reopened tab #877

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

codopanda
Copy link
Contributor

@codopanda codopanda commented Mar 7, 2024

vim.fn.tabpagenr gets the tab number but api.nvim_tabpage_set_var expects tab id, meaning the tab rename would fail if a tab was closed and reopened. This change passes 0 into api.nvim_tabpage_set_var which will use the current focused tab without needing to retrieve the id.

Before this change:

CleanShot.2024-03-07.at.01.23.01.mp4

After this change:

CleanShot.2024-03-07.at.01.24.38.mp4

PS: Thank you for making bufferline!

vim.fn.tabpagenr gets the tab number but api.nvim_tabpage_set_var
expects tab id, meaning the tab rename would fail if a tab was closed
and reopened. This change passes 0 into api.nvim_tabpage_set_var
which will use the current focused tab without needing to retrieve
the id.
@akinsho
Copy link
Owner

akinsho commented Mar 7, 2024

Thanks for the fix @codopanda especially the videos, that makes it super easy to understand what you were solving for.

@akinsho akinsho merged commit 1064399 into akinsho:main Mar 7, 2024
2 checks passed
This was referenced Mar 7, 2024
sstallion pushed a commit to sstallion/bufferline.nvim that referenced this pull request Jul 3, 2024
vim.fn.tabpagenr gets the tab number but api.nvim_tabpage_set_var
expects tab id, meaning the tab rename would fail if a tab was closed
and reopened. This change passes 0 into api.nvim_tabpage_set_var
which will use the current focused tab without needing to retrieve
the id.
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

Successfully merging this pull request may close these issues.

2 participants