fix(resession): fix vim.t.bufs arrays restoring as non-contiguous#66
Merged
mehalter merged 1 commit intoAstroNvim:mainfrom Feb 18, 2026
Merged
fix(resession): fix vim.t.bufs arrays restoring as non-contiguous#66mehalter merged 1 commit intoAstroNvim:mainfrom
mehalter merged 1 commit intoAstroNvim:mainfrom
Conversation
mehalter
approved these changes
Feb 18, 2026
Member
mehalter
left a comment
There was a problem hiding this comment.
Thanks! This is a great improvement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📑 Description
Astrocore tries to restore all tabs when it loads a session, even the ones that failed resession's buf_tab_filter and did not get saved. When this happens, those missing tabs are placed as nil in the tabpage's vim.t.bufs variable. This can cause error messages, lost tabs, and continuing unexpected behavior.
This PR will make those nil values be ignored, so the array indexes are contiguous.
It is still possible to load in and the current buffer be some unlisted bufnr because of the buf_tab_filter. I recomend that vim.cmd.bf is called somewhere if that happens. Additionally, I noticed that tab-scoped sessions seem to load in without a tabline at the top, with or without the change in this PR.
📖 Additional Information
I attached an error log caused by adding two tabs that get filtered out on session save
:TSModuleInfo
:TSModuleInfo
:q
(Reopen)
Sl
error.log