aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter/highlight_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/treesitter/highlight_spec.lua')
-rw-r--r--test/functional/treesitter/highlight_spec.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index 932af0332b..10fe08c549 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -731,6 +731,31 @@ describe('treesitter highlighting (C)', function()
eq(3, get_hl '@foo.missing.exists.bar')
eq(nil, get_hl '@total.nonsense.but.a.lot.of.dots')
end)
+
+ it('supports multiple nodes assigned to the same capture #17060', function()
+ insert([[
+ int x = 4;
+ int y = 5;
+ int z = 6;
+ ]])
+
+ exec_lua([[
+ local query = '((declaration)+ @string)'
+ vim.treesitter.query.set('c', 'highlights', query)
+ vim.treesitter.highlighter.new(vim.treesitter.get_parser(0, 'c'))
+ ]])
+
+ screen:expect {
+ grid = [[
+ {5:int x = 4;} |
+ {5:int y = 5;} |
+ {5:int z = 6;} |
+ ^ |
+ {1:~ }|*13
+ |
+ ]],
+ }
+ end)
end)
describe('treesitter highlighting (help)', function()