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

Can the context scratch buffers be reused? #533

Closed
mnzaki opened this issue Dec 4, 2024 · 5 comments · Fixed by #536
Closed

Can the context scratch buffers be reused? #533

mnzaki opened this issue Dec 4, 2024 · 5 comments · Fixed by #536

Comments

@mnzaki
Copy link
Contributor

mnzaki commented Dec 4, 2024

Is it possible to reuse the scratch buffers created instead of destroying them when context is empty and creating new ones every time a context is going to be rendered?
This way buffer numbers don't increase dramatically and also avoids triggering other plugins reacting to buffers being created/destroyed.

I'm having a particular problem with vim-airline which I have traced back to this constant cycling of buffers that nvim-treesitter-context does. The issue feels like it should be fixed in airline, but at the same time would be nice to reuse scratch buffers at least to avoid buffer numbers increasing (I easily get into the 1000s after a few hours of coding)

@lewis6991
Copy link
Member

@apollo1321

@apollo1321
Copy link
Contributor

I believe this can be easily fixed when the context becomes empty. However, if you don't use the multiwindow option, the buffer number will increase every time you switch to another window. Although this can also be addressed, the implementation will be more complex.

Anyway, I'll take a closer look at it in the near future.

@lewis6991
Copy link
Member

I believe before multiwindow was implemented we declared a single buffer and always reused it. So this in effect is another regression.

@apollo1321
Copy link
Contributor

Yes, this it true. I'll fix that.

@mnzaki
Copy link
Contributor Author

mnzaki commented Dec 6, 2024

Thank you both for your time!

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 a pull request may close this issue.

3 participants