feat(treesitter): handle quantified fold captures

This commit is contained in:
Riley Bruins
2024-04-20 10:36:17 -07:00
committed by Christian Clason
parent 8886b1807c
commit 5e6240ffc2
3 changed files with 58 additions and 18 deletions

View File

@@ -404,6 +404,28 @@ t3]])
}, get_fold_levels())
end)
it('handles quantified patterns', function()
insert([[
import hello
import hello
import hello
import hello
import hello
import hello]])
exec_lua([[vim.treesitter.query.set('python', 'folds', '(import_statement)+ @fold')]])
parse('python')
eq({
[1] = '>1',
[2] = '1',
[3] = '1',
[4] = '1',
[5] = '1',
[6] = '1',
}, get_fold_levels())
end)
it('updates folds in all windows', function()
local screen = Screen.new(60, 48)
screen:attach()