Closed lobneroO closed 5 months ago
just ran into this, seems like the defer_fn
is the cause.
if you remove the defer_fn guard from nvim-treesitter init, it should work again. I'm not sure how to retain that functionality though.
I can duplicate this with a minimal config (just ufo and treesitter installed) using packer instead of lazy.nvim. However, it only happens the first time I open a file after installing treesitter. Closing and reopening neovim fixes it.
My ufo config:
vim.o.foldcolumn = '1'
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
require('ufo').setup()
My treesitter config:
require'nvim-treesitter.configs'.setup {
ensure_installed = { "lua", "vim", "vimdoc", "query" , "latex", "python"},
sync_install = false,
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}
Here's the full stack trace:
Error in decoration provider ufo.end:
Error executing lua: .../pack/packer/start/nvim-ufo/lua/ufo/model/foldbuffer.lua:54: attempt to call method 'syntax' (a string value)
stack traceback:
.../pack/packer/start/nvim-ufo/lua/ufo/model/foldbuffer.lua:54: in function 'syntax'
...im/site/pack/packer/start/nvim-ufo/lua/ufo/decorator.lua:218: in function 'getVirtTextAndCloseFold'
...im/site/pack/packer/start/nvim-ufo/lua/ufo/decorator.lua:102: in function <...im/site/pack/packer/start/nvim-ufo/lua/ufo/decorator.lua:66>
same issue here!
I can duplicate this with a minimal config (just ufo and treesitter installed) using packer instead of lazy.nvim.
@nolanking90 How can I reproduce it?
Without reproduced steps, nobody can help.
I can duplicate this with a minimal config (just ufo and treesitter installed) using packer instead of lazy.nvim.
@nolanking90 How can I reproduce it?
Using packer, delete treesitter, then reinstall treesitter. Then open a file you want to use folding on. run :TSInstall and :TSBufEnable highlight if it doesn’t automatically, then try to use folding.
Neovim version (nvim -v | head -n1)
NVIM v0.9.4
Operating system/version
Arch Linux
How to reproduce the issue
-- { import = 'custom.plugns' },
(in my version it is line 232)I took this supposedly minimal working example from issue #117 , answer by @Rolv-Apneseth
Expected behavior
The code folds, the first line before the fold is still readable and code within the folded area disappears (i.e. is fold is closed)
Actual behavior
first line of the fold is replaced by a 0, error
(sorry, the stack is cut off in my editor. I don't know how to print it elsewhere)