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
@@ -2445,7 +2445,7 @@ impl AssistantContext {
.message_anchors
.get(next_message_ix)
.map_or(buffer.len(), |message| {
buffer.clip_offset(message.start.to_offset(buffer) - 1, Bias::Left)
buffer.clip_offset(message.start.to_previous_offset(buffer), Bias::Left)
});
Some(self.insert_message_at_offset(offset, role, status, cx))
} else {