Comments (8)
And should :mksession work with options set the way you suggest?
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
- document that treesitter foldexpr should be set in FileType autocmd or ftplugin; or
- let treesitter fold module setup FileType autocmd to reevaluate foldexpr, so that it works even when the user doesn't do that
from neovim.
Try evaluating vim.treesitter.foldexpr()
manually, e.g. :lua= vim.treesitter.foldexpr(3)
and see what it prints. Check setlocal foldexpr
and setlocal foldmethod
too.
Also ensure the TS parser exists and works for the buffer: :lua= vim.treesitter.get_parser(0):lang()
.
from neovim.
You need to set these options in a FileType autocommand or ftplugin; these are not "global options".
from neovim.
And should :mksession
work with options set the way you suggest? From the help file it looks like it might only track global options.
If it does not restore local options, does that mean I cannot restore folds (sessionoptions
) in conjunction with nvim-treesitter?
from neovim.
The folds from treesitter behave exactly like other folds.
from neovim.
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.
from neovim.
That's all the time I have for, unfortunately. You can try your luck with @lewis6991.
from neovim.
Fair enough, just my frustration speaking as I've gotten stuck on this far too long, apologies!
from neovim.
Related Issues (20)
- Default c/cpp commentstring HOT 21
- neovim 0.10.0 linux64 release tarball needs glibc 2.28/2.29 HOT 6
- nvim sends excessive amount of grid_cursor_goto when pmenu is open with ext_popupmenu HOT 3
- Undercurl behavior is inconsistent due to flaky detection of the terminal (Konsole)
- rpc fail invalid header line "contents.py"` HOT 3
- Crashed when executing LazyCheck HOT 1
- Closing floating window flashes Normal highlight color when using fzf.vim (Neovim bug or fzf.vim?) Started happening with neovim 0.10 HOT 1
- LSP de-sync when using softtabstop=-1 with foldmethod=indent HOT 7
- Neovim doesn't respect my colorscheme in version 0.10.0 HOT 3
- Screenchar/screenstring does not work with multigrid
- error_exit ui event is not documented
- Better Bengali Fonts support! Or Terminal Bengali Text Rendering is an unsolvable problem?
- MatchParen and Visual highlights are indistinguishable in default colorscheme
- Unsupported method warning issued when calling `vim.lsp.codelens.run` HOT 2
- LSP: using changedtick as the document version breaks workspace/executeCommand usage HOT 13
- Programmatic way of getting spelling errors HOT 10
- vim.snippet.expand : support nested placeholders
- <afile> cannot be expanded when running with -V1 HOT 2
- Built-in xml tags auto- close and rename HOT 6
- nvim -l does not support reading from stdin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim.