diff options
| author | Matthieu Coudron <mattator@gmail.com> | 2020-06-06 15:37:51 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-06 15:37:51 +0200 | 
| commit | dbc8ec94464049311e69274cad562585d7bb6749 (patch) | |
| tree | 3f0580a30098f12aa0eb2749f588b503156a8ac6 /runtime/lua/vim/treesitter.lua | |
| parent | 39f802bef4fa211349bc1489770645608466a378 (diff) | |
| parent | 6b949211a06e21af67bf4cb3a20c6f87c932ef2a (diff) | |
| download | rneovim-dbc8ec94464049311e69274cad562585d7bb6749.tar.gz rneovim-dbc8ec94464049311e69274cad562585d7bb6749.tar.bz2 rneovim-dbc8ec94464049311e69274cad562585d7bb6749.zip | |
Merge pull request #12321 from vigoux/treesitter-runtime
treesitter: update runtime
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter.lua | 5 | 
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 | 
