diff --git a/crates/assistant_tools/src/edit_file_tool.rs b/crates/assistant_tools/src/edit_file_tool.rs index 0c995a58fc0da8f74b871acae257826497d80429..be276fcc816371738f22d1e9b6c22cfa5da79968 100644 --- a/crates/assistant_tools/src/edit_file_tool.rs +++ b/crates/assistant_tools/src/edit_file_tool.rs @@ -577,13 +577,10 @@ impl ToolCard for EditFileToolCard { card.child( v_flex() .relative() - .map(|editor_container| { - if self.full_height_expanded { - editor_container.h_full() - } else { - editor_container - .h(DEFAULT_COLLAPSED_LINES as f32 * editor_line_height) - } + .h_full() + .when(!self.full_height_expanded, |editor_container| { + editor_container + .max_h(DEFAULT_COLLAPSED_LINES as f32 * editor_line_height) }) .overflow_hidden() .border_t_1() diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index c1a71d654b0214ea9ff4c765916335a4731656fe..2fdfd7d8a9d083ee9edbf6d54c13b0f04007b795 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -6871,7 +6871,12 @@ impl Element for EditorElement { // The max scroll position for the top of the window let max_scroll_top = if matches!( snapshot.mode, - EditorMode::AutoHeight { .. } | EditorMode::SingleLine { .. } + EditorMode::SingleLine { .. } + | EditorMode::AutoHeight { .. } + | EditorMode::Full { + sized_by_content: true, + .. + } ) { (max_row - height_in_lines + 1.).max(0.) } else {