This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Description
The offset directive (see :h offset!) is very useful for adjust a captures range however it does not change the range directly but instead adds a adjusted range to the content field to the metadata of the capture. Example query:
((string) @capture (#offset! @capture 0 1 0 -1))
This will adjust the range in the metadata to start one column later and end one column earlier. In python this gets the range of the string without the "
Currently the playground does not support this (probably because it uses node:range()). I think this could trivially be supported using:
local function range(node, meta)
if meta.content ~= nil then
return unpack(meta.content[1])
else
return node:range()
end
end
I do not have the time right now but if you point me to where the query highlighting range is called I will drop in the change tomorrow and test it