WIP: start on editor element

This commit is contained in:
Antonio Scandurra
2023-11-03 17:14:17 +01:00
parent 580694dbda
commit d3b02c4de4
5 changed files with 215 additions and 94 deletions
+3 -3
View File
@@ -48,11 +48,11 @@ impl AutoscrollStrategy {
impl Editor {
pub fn autoscroll_vertically(
&mut self,
viewport_height: f32,
line_height: f32,
viewport_height: Pixels,
line_height: Pixels,
cx: &mut ViewContext<Editor>,
) -> bool {
let visible_lines = viewport_height / line_height;
let visible_lines = f32::from(viewport_height / line_height);
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
let mut scroll_position = self.scroll_manager.scroll_position(&display_map);
let max_scroll_top = if matches!(self.mode, EditorMode::AutoHeight { .. }) {