From 83fc7b9b7c77ffb31692a191cf10da192f6f559b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 28 Jun 2023 10:32:06 +0200 Subject: [PATCH] Avoid scrolling to the new cursor position so the assistant's output is stable Co-Authored-By: Antonio Scandurra --- crates/ai/src/assistant.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ai/src/assistant.rs b/crates/ai/src/assistant.rs index dde527d89cfb48fb54f2734a1646f1487cc5e719..7631381273a56c3920e2b2179359a4f10ab9611f 100644 --- a/crates/ai/src/assistant.rs +++ b/crates/ai/src/assistant.rs @@ -1681,6 +1681,8 @@ impl ConversationEditor { |selections| selections.select_ranges(new_selections), ); }); + // Avoid scrolling to the new cursor position so the assistant's output is stable. + cx.defer(|this, _| this.scroll_position = None); } }