diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 613232c5ca..7d53caeba9 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -6681,7 +6681,10 @@ impl Element for EditorElement { let max_row = snapshot.max_point().row().as_f32(); // The max scroll position for the top of the window - let max_scroll_top = if matches!(snapshot.mode, EditorMode::AutoHeight { .. }) { + let max_scroll_top = if matches!( + snapshot.mode, + EditorMode::AutoHeight { .. } | EditorMode::SingleLine { .. } + ) { (max_row - height_in_lines + 1.).max(0.) } else { let settings = EditorSettings::get_global(cx);