Commit Graph

4 Commits

Author SHA1 Message Date
Cormac Relf
9fbb0932c0 tree-sitter: ignore matches in inner scopes
Previously, placing the cursor on line 1 would highlight every elif and
else in the whole block of code. % would jump to line 4, then % from
there would cycle between lines 2, 4 and 6.

 1   if noice:
 2       if yeah:
 3           pass
 4       elif no:
 5           pass
 6       else:
 7           pass
 8   elif blah:
 9       pass
10   else:
11       pass

With the change, which I think the code had contemplated given there was
already an unused `M.containing_scope(node, bufnr, info.key)` call, % will
only move between ifs and elses that are in the same `@scope.if_`, and
not to any inner scopes. Hence the example will have two mutually
exclusive %-cycles: [1, 8, 10] and [2, 4, 6].
2021-03-17 15:20:27 +11:00
Andy K. Massimino
71132a93ea Add a tree-sitter test 2021-02-26 00:08:19 -05:00
Andy K. Massimino
9c6e7410a3 Check for nvim-treesitter 2021-02-25 22:56:38 -05:00
Andy K. Massimino
e3bc1fa821 Add neovim tree-sitter integration 2021-02-25 22:48:13 -05:00