mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
feat(treesitter): add folding for InspectTree
(#27518)
As the InspectTree buffer is now a valid tree-sitter query tree, we can use the bundled fold queries to have folding for the tree.
This commit is contained in:
@@ -159,7 +159,10 @@ end
|
||||
local function set_dev_properties(w, b)
|
||||
vim.wo[w].scrolloff = 5
|
||||
vim.wo[w].wrap = false
|
||||
vim.wo[w].foldmethod = 'manual' -- disable folding
|
||||
vim.wo[w].foldmethod = 'expr'
|
||||
vim.wo[w].foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- explicitly set foldexpr
|
||||
vim.wo[w].foldenable = false -- Don't fold on first open InspectTree
|
||||
vim.wo[w].foldlevel = 99
|
||||
vim.bo[b].buflisted = false
|
||||
vim.bo[b].buftype = 'nofile'
|
||||
vim.bo[b].bufhidden = 'wipe'
|
||||
|
Reference in New Issue
Block a user