-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E490: no fold found
with tree-sitter
#28692
Comments
You need to set these options in a FileType autocommand or ftplugin; these are not "global options". |
And should If it does not restore local options, does that mean I cannot restore folds ( |
The folds from treesitter behave exactly like other folds. |
As sparse as ever with your answers. I would have liked to figure this out with vanilla nvim, but will return to using nvim-ufo then, which somehow handles these use cases. |
That's all the time I have for, unfortunately. You can try your luck with @lewis6991. |
Fair enough, just my frustration speaking as I've gotten stuck on this far too long, apologies! |
Try evaluating Also ensure the TS parser exists and works for the buffer: |
Yes that works. The problem in the repro script is that filetype is not set when foldexpr is first evaluated, so the foldexpr doesn't recognize the language. Setting up an FileType autocmd to set foldexpr will reevaluate foldexpr with proper filetype. So there are two options for improvements
|
Problem
Tree-sitter computed folds don't work on files opened through commands. This breaks session restore functionality.
Related:
Steps to reproduce
minimal.lua:
helloworld.c:
Steps:
nvim --clean -u minimal.lua
za
on foldable sectionE490: no fold found
Entering insert mode or pressing
zx
seems to restore fold functionality. Not working without these actions breaks a complete session restore.Expected behavior
Folds should always work, including those restored via sessions.
Neovim version (nvim -v)
NVIM v0.10.0-dev-3103+gca735c755
Vim (not Nvim) behaves the same?
not applicable
Operating system/version
Arch Linux x86_64
Terminal name/version
Alacritty 0.13.2-2
$TERM environment variable
alacritty
Installation
GitHub nightly tarball
The text was updated successfully, but these errors were encountered: