Description
When I open a file from telescope, views aren't restored (e.g. cursor position, folds) and tree-sitter highlighting isn't used. Instead syntax highlighting is used. I can't create new folds either.
Expected Behavior When I open a file from telescope, views should be restored in the same way as when I open a file directly. Treesitter should be enabled just as it is when normally opening a file.
Actual Behavior
Views aren't restored and treesitter isn't used. In order to get treesitter to work correctly and my views restored, I need to reload the buffer (:e) after opening the file. If I do just :loadview my view is restored, but treesitter highlighting is not. You can see that :e restores treesitter highlighting as doing :syntax before will give you the syntax items, whereas after :e it gives No Syntax items defined for this buffer.
Details
Reproduce
- open some file with folding and tree-sitter highlighting (e.g. a lua file)
- Move the cursor, open/close some folds
- close nvim
- run nvim
- open telescope with e.g.
:Telescope find_files - search for previous file and open it
Environment
- nvim --version: NVIM v0.5.0-dev+1109-g6b7cc45c4