text: Implement Rope::clip_offset in terms of the new utf8 boundary methods (#38630)

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth
2025-09-22 11:45:23 +00:00
committed by GitHub
parent 50bd8bc255
commit 55dc9ff7ca
5 changed files with 12 additions and 26 deletions
+2 -2
View File
@@ -4198,8 +4198,8 @@ impl BufferSnapshot {
range: Range<T>,
options: TreeSitterOptions,
) -> impl Iterator<Item = (Range<usize>, TextObject)> + '_ {
let range = range.start.to_offset(self).saturating_sub(1)
..self.len().min(range.end.to_offset(self) + 1);
let range =
range.start.to_previous_offset(self)..self.len().min(range.end.to_next_offset(self));
let mut matches =
self.syntax