Closed KneeCapStealer closed 8 months ago
I accually have a GitHub Repo with my nvim config if that is useful
Same here, has been like this for a few weeks now, on nightly and on 0.9.4.
Provide a mini config and reproduce the issue, otherwise debug yourself. Maybe the log file can give you some information.
tail -f ~/.cache/nvim/ufo.log in a shell
;UFO_LOG=debug nvim
;@kevinhwang91 Well, I will try to provide a minimal setup once I found some time, but basically I followed you setup guide for treesitter.
The log says nothing, except periodically printing for each error message that appears inside neovim [23-11-11 15:40:21] [DEBUG] decorator.lua:77 : folded lnums: { 5 } didOpen: false
, and the error in neovim being:
Error in decoration provider ufo.end:
Error executing lua: ....local/share/nvim/lazy/nvim-ufo/lua/ufo/model/buffer.lua:217: index out of bounds
stack traceback:
[C]: in function 'assert'
....local/share/nvim/lazy/nvim-ufo/lua/ufo/model/buffer.lua:217: in function 'lines'
...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:97: in function 'winCall'
...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:74: in function <...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:65>
@kevinhwang91 Well, I will try to provide a minimal setup once I found some time, but basically I followed you setup guide for treesitter. The log says nothing, except periodically printing for each error message that appears inside neovim
[23-11-11 15:40:21] [DEBUG] decorator.lua:77 : folded lnums: { 5 } didOpen: false
, and the error in neovim being:Error in decoration provider ufo.end: Error executing lua: ....local/share/nvim/lazy/nvim-ufo/lua/ufo/model/buffer.lua:217: index out of bounds stack traceback: [C]: in function 'assert' ....local/share/nvim/lazy/nvim-ufo/lua/ufo/model/buffer.lua:217: in function 'lines' ...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:97: in function 'winCall' ...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:74: in function <...es/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:65>
Look like ufo doesn't attach your buffer, UFO_LOG=trace nvim
may help, ufo will attach buffer in BufEnter
event.
Look like ufo doesn't attach your buffer,
UFO_LOG=trace nvim
may help, ufo will attach buffer inBufEnter
event.
Ah dang it, you are right, I was not letting UFO attach at the right event with Lazy.nvim. Thanks!
Ah dang it, you are right, I was not letting UFO attach at the right event with Lazy.nvim. Thanks!
I didn't have a lot of time (and kinda forgot) to check up on this issue. Thank you for writing your fix, this worked for me as well!
Neovim version (nvim -v | head -n1)
NVIM v0.9.4 Build type: RelWithDebInfo LuaJIT 2.1.1696883897
Operating system/version
Windows 11 Home 10.0.22621
How to reproduce the issue
cat plugins/ufo.lua
Other plugins:
Reproduce
za
to close a fold (The error doesn't come if you do it on a luareturn {}
)0
is displayed at foldExpected behavior
Works:
It accually works when i use it on a
return { }
in lua. And this is how i expect it to work in all other cases as well: (Extra lines at the top to show errors in later photos)Image
Actual behavior
Instead of displaying proper fold text it shows a
0
instead and an error is displayed. Besides this the folding works fine.Images:
Close fold with
za
and move cursor:Close fold and open fold with
za