Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change cursor to ignore child's end points
...when running goto_first_child_for_{byte or point}. My problem: I have a following markdown document ``` {Node document (0, 0) - (11, 0)} document 91 {Node section (0, 0) - (8, 0)} section 101 // .. ignorable details {Node section (8, 0) - (11, 0)} section 101 // .. ignorable details ``` (indent describes child) When I run `goto_first_child_for_point` with (8, 0), I expected to get the second section which spans (8, 0) to (11, 0). Instead I got the first section which spans (0, 0) to (8, 0). My suggestion: Given that the range is start-inclusive and end-exclusive, I'm wondering tree-sitter can change the walk behavior to follow the same semantics, by excluding the end position of the node when considering the child. Code change itself is trivial. Affected test cases were updated which I believe for a good reason.
- Loading branch information