aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/treesitter/highlight_spec.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index c59160d8c7..6d59368a24 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -1298,3 +1298,16 @@ it('starting and stopping treesitter highlight in init.lua works #29541', functi
-- legacy syntax highlighting is used
screen:expect(hl_grid_legacy_c)
end)
+
+it('no nil index for missing highlight query', function()
+ clear()
+ local cqueries = vim.uv.cwd() .. '/runtime/queries/c/'
+ os.rename(cqueries .. 'highlights.scm', cqueries .. '_highlights.scm')
+ finally(function()
+ os.rename(cqueries .. '_highlights.scm', cqueries .. 'highlights.scm')
+ end)
+ exec_lua([[
+ local parser = vim.treesitter.get_parser(0, 'c')
+ vim.treesitter.highlighter.new(parser)
+ ]])
+end)