fix(rust): correct indices for Node::utf16_text
This commit is contained in:
parent
32c88194f5
commit
d3c2fed4b3
2 changed files with 14 additions and 1 deletions
|
|
@ -2067,7 +2067,7 @@ impl<'tree> Node<'tree> {
|
|||
|
||||
#[must_use]
|
||||
pub fn utf16_text<'a>(&self, source: &'a [u16]) -> &'a [u16] {
|
||||
&source[self.start_byte()..self.end_byte()]
|
||||
&source[self.start_byte() / 2..self.end_byte() / 2]
|
||||
}
|
||||
|
||||
/// Create a new [`TreeCursor`] starting from this node.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue