aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-06-03 19:58:02 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-06-03 19:58:02 +0200
commit6a93077475d298f46ac19c8030ed5b4a723685dc (patch)
treedcc0a423ff180900bfd7699dfe28e5a3950ae74e /runtime/lua/vim/treesitter.lua
parent662688817b2156edd47019f00f53774e5e00224a (diff)
downloadrneovim-6a93077475d298f46ac19c8030ed5b4a723685dc.tar.gz
rneovim-6a93077475d298f46ac19c8030ed5b4a723685dc.tar.bz2
rneovim-6a93077475d298f46ac19c8030ed5b4a723685dc.zip
treesitter: fix tests
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
-rw-r--r--runtime/lua/vim/treesitter.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index d3b78a7f73..c502e45bd0 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -162,16 +162,17 @@ function Query:match_preds(match, pattern, bufnr)
-- Here we only want to return if a predicate DOES NOT match, and
-- continue on the other case. This way unknown predicates will not be considered,
-- which allows some testing and easier user extensibility (#12173).
+ -- Also, tree-sitter strips the leading # from predicates for us.
if pred[1] == "eq?" then
local node = match[pred[2]]
local node_text = get_node_text(node, bufnr)
local str
if type(pred[3]) == "string" then
- -- (eq? @aa "foo")
+ -- (#eq? @aa "foo")
str = pred[3]
else
- -- (eq? @aa @bb)
+ -- (#eq? @aa @bb)
str = get_node_text(match[pred[3]], bufnr)
end