Coder Social home page Coder Social logo

Comments (7)

HiPhish avatar HiPhish commented on August 17, 2024 1

@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.

HiPhish avatar HiPhish commented on August 17, 2024 1

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:

  1. This is a bug in Neovim
  2. 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.

HiPhish avatar HiPhish commented on August 17, 2024

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.

HiPhish avatar HiPhish commented on August 17, 2024

@luozhiya Can you please try the on-detach branch and report back if the problem still happens?

from nvim-ts-rainbow2.

akinsho avatar akinsho commented on August 17, 2024

@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.

HiPhish avatar HiPhish commented on August 17, 2024

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.

HiPhish avatar HiPhish commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.