mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
Ensure there is a nested table allocated for #set!
Fixes the following bug: ``` test/functional/helpers.lua:107: Error executing lua: vim/treesitter/query.lua:256: attempt to index a nil value ```
This commit is contained in:
@@ -253,7 +253,11 @@ local directive_handlers = {
|
||||
["set!"] = function(_, _, _, pred, metadata)
|
||||
if #pred == 4 then
|
||||
-- (#set! @capture "key" "value")
|
||||
metadata[pred[2]][pred[3]] = pred[4]
|
||||
local capture = pred[2]
|
||||
if not metadata[capture] then
|
||||
metadata[capture] = {}
|
||||
end
|
||||
metadata[capture][pred[3]] = pred[4]
|
||||
else
|
||||
-- (#set! "key" "value")
|
||||
metadata[pred[2]] = pred[3]
|
||||
|
||||
Reference in New Issue
Block a user