Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix GoToDefinition changing the viewport unnecessarily (#18441)
Ömer Sinan Ağacandc5ffe6994b0
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 44de6014ec8..cfffa584b6c 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -9697,7 +9697,7 @@ impl Editor {if Some(&target.buffer) == editor.buffer.read(cx).as_singleton().as_ref() {let buffer = target.buffer.read(cx);let range = check_multiline_range(buffer, range);- editor.change_selections(Some(Autoscroll::focused()), cx, |s| {+ editor.change_selections(Some(Autoscroll::fit()), cx, |s| {s.select_ranges([range]);});} else {