diff options
| author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-04-23 07:55:00 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-04-25 21:46:22 +0200 |
| commit | 78b40f895cb2bf789944f94abd47dd7f7ab3f8dc (patch) | |
| tree | e8af2320312a4a78ee151167eb4dcdaef8ac1a68 /lua/nvim-treesitter/locals.lua | |
| parent | 2ca0c348f73655b395ded2e60e13ba0c2249dc74 (diff) | |
textobj: add incremental node selection
Diffstat (limited to 'lua/nvim-treesitter/locals.lua')
| -rw-r--r-- | lua/nvim-treesitter/locals.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 388c7e48..1e19fcd4 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -68,8 +68,8 @@ function M.get_definitions(bufnr) local defs = {} for _, loc in ipairs(locals) do - if loc.definition then - table.insert(defs, {definition=loc.definition, kind=loc.kind}) + if loc.definition and loc.definition.node then + table.insert(defs, {node=loc.definition.node, kind=loc.kind}) end end @@ -82,8 +82,8 @@ function M.get_scopes(bufnr) local scopes = {} for _, loc in ipairs(locals) do - if loc.scope then - table.insert(scopes, loc.scope) + if loc.scope and loc.scope.node then + table.insert(scopes, loc.scope.node) end end @@ -96,8 +96,8 @@ function M.get_references(bufnr) local refs = {} for _, loc in ipairs(locals) do - if loc.reference then - table.insert(refs, loc.reference) + if loc.reference and loc.reference.node then + table.insert(refs, loc.reference.node) end end |
