Passing tests and removed local argument. Also pulled autoscroll argument out to change_selections

This commit is contained in:
Keith Simmons 2022-05-12 14:18:46 -07:00
parent c9dcfff607
commit db0a9114c2
19 changed files with 351 additions and 397 deletions

View file

@ -5,7 +5,7 @@ use collections::{BTreeSet, HashSet};
use editor::{
diagnostic_block_renderer,
display_map::{BlockDisposition, BlockId, BlockProperties, RenderBlock},
highlight_diagnostic_message, Editor, ExcerptId, MultiBuffer, ToOffset,
highlight_diagnostic_message, Autoscroll, Editor, ExcerptId, MultiBuffer, ToOffset,
};
use gpui::{
actions, elements::*, fonts::TextStyle, serde_json, AnyViewHandle, AppContext, Entity,
@ -418,7 +418,7 @@ impl ProjectDiagnosticsEditor {
} else {
groups = self.path_states.get(path_ix)?.diagnostic_groups.as_slice();
new_excerpt_ids_by_selection_id =
editor.change_selections(true, cx, |s| s.refresh());
editor.change_selections(Some(Autoscroll::Fit), cx, |s| s.refresh());
selections = editor
.selections
.interleaved::<usize>(&editor.buffer().read(cx).read(cx));
@ -444,8 +444,8 @@ impl ProjectDiagnosticsEditor {
}
}
}
editor.change_selections(true, cx, |s| {
s.select(selections, None);
editor.change_selections(None, cx, |s| {
s.select(selections);
});
Some(())
});