Comments (7)
@akinsho That branch does not really fix the problem, it just shoves it under the rug. There seems to be a resource leak which :Bdelete
is tripping up on and I want to plug the leak. My last commit did plug a leak, but apparently it was not enough. I will have to install famiu/bufdelete.nvim myself and see what the command does.
from nvim-ts-rainbow2.
I have pinned down the problem: In Neovim 0.10 deleting a buffer emits an on_changedtree
event (see :h LanguageTree:register_cbs()
), but since the buffer is deleted this raises all sort of problems. So the issue is not a resource leak after all. There are two possibilities:
- This is a bug in Neovim
- This is a deliberate choice in Neovim
If it is the former I can sit back and wait. If it is the latter I will have to handle this particular edge case like in the PR posted by the OP. I will file an issue in Neovim's repo, then we will see.
from nvim-ts-rainbow2.
The on_detach
callback is not documented (:h LanguageTree:register_cbs()
). You do raise a good point though: if a buffer is deleted the current callbacks are never called, which is a resource leak. From reading the source it seems that on_detach
is too radical, it will fire even if the user executes :edit
. Perhaps a buffer_is_loaded()
check at the beginning will do the trick.
from nvim-ts-rainbow2.
@luozhiya Can you please try the on-detach
branch and report back if the problem still happens?
from nvim-ts-rainbow2.
@HiPhish I've been experiencing this issue as well and tried your branch but it still happens on that branch. It does seem to be fixed on @luozhiya's branch though i.e. #42
from nvim-ts-rainbow2.
I have been able to narrow down the issue. It only happens in the current dev builds, not in 0.9. If I have two windows with a different buffer for each and I execute :bdelete
on one of them I get the error.
from nvim-ts-rainbow2.
The PR has been merged. Please test if the problem has been solved on master
and close this issue if everything is correct now.
from nvim-ts-rainbow2.
Related Issues (20)
- Highlight errors inside #if 0 HOT 6
- react colors are incorrect in the default config HOT 10
- Don't work HOT 3
- vim.treesitter.query.get_query() is deprecated, use vim.treesitter.query.get() instead. HOT 3
- Error on startup (neovim 0.9) HOT 9
- Top level brackets are not highlighted when toggling rainbow HOT 4
- I want a dracula theme like highlight group HOT 1
- More clear instructions for custom color definitions HOT 4
- Feature Request: Add queries for Ruby HOT 1
- Mismatched brackets in .tex file editing (LaTeX) HOT 1
- [Bug] Punctuation highlight is changed to deprecated `TSPunctBracket` HOT 4
- TSEnable/TSDisable rainbow doesn't work HOT 2
- ts-rainbow not found HOT 1
- Long freezes when opening/editing zig files HOT 5
- Bracket coloring inconsistent HOT 8
- Neovim 0.9.1 hangs consuming 100% CPU HOT 8
- [Bug]: highlighting broken after lsp format HOT 8
- [Bug]: nvim-cmp window reactivates rainbow after it's been disabled HOT 4
- Cannot highlight parentheses in real-time HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-ts-rainbow2.