Avoid scrolling to the new cursor position so the assistant's output is stable

Nathan Sobo and Antonio Scandurra created

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Change summary

crates/ai/src/assistant.rs | 2 ++
1 file changed, 2 insertions(+)

Detailed changes

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);
         }
     }