Avoid auto-scrolling the editor when inserting/removing headers

This commit is contained in:
Antonio Scandurra 2023-06-14 10:49:23 +02:00
parent f8b9417406
commit 1aa1774688
5 changed files with 29 additions and 7 deletions

View file

@ -430,7 +430,7 @@ impl ProjectDiagnosticsEditor {
});
self.editor.update(cx, |editor, cx| {
editor.remove_blocks(blocks_to_remove, cx);
editor.remove_blocks(blocks_to_remove, None, cx);
let block_ids = editor.insert_blocks(
blocks_to_add.into_iter().map(|block| {
let (excerpt_id, text_anchor) = block.position;
@ -442,6 +442,7 @@ impl ProjectDiagnosticsEditor {
disposition: block.disposition,
}
}),
Some(Autoscroll::fit()),
cx,
);