multi_buffer: Reduce RefCell::borrow_mut calls to the bare minimum (#40522)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-10-17 18:17:34 +00:00
committed by GitHub
parent 1fbe1e3512
commit 27dcdb5841
9 changed files with 283 additions and 295 deletions
+2 -1
View File
@@ -6887,7 +6887,8 @@ impl Editor {
continue;
}
let range = Anchor::range_in_buffer(excerpt_id, buffer_id, start..end);
let range =
Anchor::range_in_buffer(excerpt_id, buffer_id, *start..*end);
if highlight.kind == lsp::DocumentHighlightKind::WRITE {
write_ranges.push(range);
} else {
+1 -1
View File
@@ -7465,7 +7465,7 @@ impl EditorElement {
let clipped_start = range.start.max(&buffer_range.start, buffer);
let clipped_end = range.end.min(&buffer_range.end, buffer);
let range = buffer_snapshot
.anchor_range_in_excerpt(excerpt_id, clipped_start..clipped_end)?;
.anchor_range_in_excerpt(excerpt_id, *clipped_start..*clipped_end)?;
let start = range.start.to_display_point(display_snapshot);
let end = range.end.to_display_point(display_snapshot);
let selection_layout = SelectionLayout {