Fix outline panel navigation in unnamed files (#23273)

Kirill Bulatov created

Closes https://github.com/zed-industries/zed/issues/23250

Release Notes:

- Fixed outline panel navigation in unnamed files

Change summary

crates/outline_panel/src/outline_panel.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

crates/outline_panel/src/outline_panel.rs 🔗

@@ -1066,7 +1066,9 @@ impl OutlinePanel {
                                 }
                             }
                         } else {
-                            offset.y = -(active_editor.read(cx).file_header_size() as f32);
+                            if multi_buffer_snapshot.as_singleton().is_none() {
+                                offset.y = -(active_editor.read(cx).file_header_size() as f32);
+                            }
                             if show_excerpt_controls {
                                 offset.y -= expand_excerpt_control_height;
                             }