editor: Remove buffer and display map fields from SelectionsCollection (#42175)
Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -315,11 +315,15 @@ impl ProjectDiagnosticsEditor {
|
||||
cx: &mut Context<Self>,
|
||||
retain_selections: bool,
|
||||
) {
|
||||
let buffer_ids = self.multibuffer.read(cx).all_buffer_ids();
|
||||
let selected_buffers = self.editor.update(cx, |editor, cx| {
|
||||
let snapshot = self
|
||||
.editor
|
||||
.update(cx, |editor, cx| editor.display_snapshot(cx));
|
||||
let buffer = self.multibuffer.read(cx);
|
||||
let buffer_ids = buffer.all_buffer_ids();
|
||||
let selected_buffers = self.editor.update(cx, |editor, _| {
|
||||
editor
|
||||
.selections
|
||||
.all_anchors(cx)
|
||||
.all_anchors(&snapshot)
|
||||
.iter()
|
||||
.filter_map(|anchor| anchor.start.buffer_id)
|
||||
.collect::<HashSet<_>>()
|
||||
|
||||
@@ -156,7 +156,9 @@ async fn test_diagnostics(cx: &mut TestAppContext) {
|
||||
// Cursor is at the first diagnostic
|
||||
editor.update(cx, |editor, cx| {
|
||||
assert_eq!(
|
||||
editor.selections.display_ranges(cx),
|
||||
editor
|
||||
.selections
|
||||
.display_ranges(&editor.display_snapshot(cx)),
|
||||
[DisplayPoint::new(DisplayRow(3), 8)..DisplayPoint::new(DisplayRow(3), 8)]
|
||||
);
|
||||
});
|
||||
@@ -232,7 +234,9 @@ async fn test_diagnostics(cx: &mut TestAppContext) {
|
||||
// Cursor keeps its position.
|
||||
editor.update(cx, |editor, cx| {
|
||||
assert_eq!(
|
||||
editor.selections.display_ranges(cx),
|
||||
editor
|
||||
.selections
|
||||
.display_ranges(&editor.display_snapshot(cx)),
|
||||
[DisplayPoint::new(DisplayRow(8), 8)..DisplayPoint::new(DisplayRow(8), 8)]
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user