eddiebergman / nvim-treesitter-pyfold

Some sane Python folding with nvim-treesitter
33 stars 3 forks source link

Doesn't work at AstronVim 3.0 with Lazy plugin manager #11

Open alexveden opened 1 year ago

alexveden commented 1 year ago

I was trying to upgrade AstronVim to new 3.0, apparently they switched from Packer to Lazy plugin manager.

My setup:

:TSConfigInfo
 pyfold = {
      custom_foldtext = true,
      disable = {},
      enable = true,
      loaded = true,
      module_path = "nvim-treesitter-pyfold.folding"
    }
:set foldmethod?
  foldmethod=expr
:set foldexpr?
  foldexpr=nvim_treesitter#foldexpr()
:set foldtext?
  foldtext=nvim_treesitter_pyfold#foldtext()

PyFold's M.attach() method is called successfully, but no folds produced by the plugin at all, also M.foldtext() has never being called.

If I disable nvim-treesitter-pyfold original TS folds are working.

p.s. With the new Lazy plugin manager there was an issue with loading folds.scm at this line, but even after patch, PyFold still doesn't work. Vim rtp pattern was not found (weird!). What do you think this could be a root cause?

Any ideas on debugging appreciated.

alexveden commented 1 year ago

I believe I've found the issue:

fold_query = fold_query:gsub('fold', 'foldopen')

https://github.com/eddiebergman/nvim-treesitter-pyfold/blame/master/lua/nvim-treesitter-pyfold/folding.lua#L36