You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `point`: a vector in the form of `[row column]`, where `row` and `column` are zero-based. This is different from Emacs's concept of "point". Also note that `column` counts bytes, unlike the current built-in function `current-column`.
78
-
- `range`: a vector in the form of `[start-point end-point]`.
77
+
- `point`: a pair of `(LINE-NUMBER . BYTE-COLUMN)`.
78
+
+ `LINE-NUMBER` is the absolute line number returned by `line-number-at-pos`, counting from 1.
79
+
+ `BYTE-COLUMN` counts from 0, like `current-column`. However, unlike that function, it counts bytes, instead of displayed glyphs.
80
+
- `range`: a vector in the form of `[START-BYTEPOS END-BYTEPOS START-POINT END-POINT]`.
79
81
80
82
These types are understood only by this package. They are not recognized by `type-of`, but have corresponding type-checking predicates, which are useful for debugging: `ts-language-p`, `ts-tree-p`, `ts-node-p`...
81
83
84
+
For consistency with Emacs's conventions, this binding has some differences compared to the tree-sitter's C/Rust APIs:
85
+
- It uses 1-based byte position, not 0-based byte offset.
0 commit comments