Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index 1db2d619..5bde08e3 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -9,13 +9,13 @@ use crate::{
},
line_ending::get_line_ending,
movement::Direction,
+ tree_sitter::Node,
Assoc, ChangeSet, RopeSlice,
};
use helix_stdx::range::is_subset;
use helix_stdx::rope::{self, RopeSliceExt};
use smallvec::{smallvec, SmallVec};
use std::{borrow::Cow, iter, slice};
-use tree_sitter::Node;
/// A single selection range.
///
@@ -76,8 +76,8 @@ impl Range {
}
pub fn from_node(node: Node, text: RopeSlice, direction: Direction) -> Self {
- let from = text.byte_to_char(node.start_byte());
- let to = text.byte_to_char(node.end_byte());
+ let from = text.byte_to_char(node.start_byte() as usize);
+ let to = text.byte_to_char(node.end_byte() as usize);
Range::new(from, to).with_direction(direction)
}