aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter/fold_spec.lua
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-04-20 10:36:17 -0700
committerChristian Clason <c.clason@uni-graz.at>2024-04-20 22:11:45 +0200
commit5e6240ffc24e55ecf7721fd9dc3f33c6f178be8c (patch)
treeb8fed520b00009bcc72a7d2500cb3f988a7b17a1 /test/functional/treesitter/fold_spec.lua
parent8886b1807c4c0fd96558f198e4fc8cf962a7cc5b (diff)
downloadrneovim-5e6240ffc24e55ecf7721fd9dc3f33c6f178be8c.tar.gz
rneovim-5e6240ffc24e55ecf7721fd9dc3f33c6f178be8c.tar.bz2
rneovim-5e6240ffc24e55ecf7721fd9dc3f33c6f178be8c.zip
feat(treesitter): handle quantified fold captures
Diffstat (limited to 'test/functional/treesitter/fold_spec.lua')
-rw-r--r--test/functional/treesitter/fold_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/treesitter/fold_spec.lua b/test/functional/treesitter/fold_spec.lua
index fc0996dd7f..06f97dc9bb 100644
--- a/test/functional/treesitter/fold_spec.lua
+++ b/test/functional/treesitter/fold_spec.lua
@@ -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()