From afc5b525f12b0160819c1facf8142d607209d0c3 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 30 Nov 2023 14:51:22 -0700 Subject: [PATCH] Buffer: fix max scroll going one line beyond end --- src/buffer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.rs b/src/buffer.rs index c67547c013..fc285b5897 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -480,7 +480,7 @@ impl Buffer { let scroll_end = self.scroll + lines; let total_layout = self.shape_until(font_system, scroll_end); - self.scroll = cmp::max(0, cmp::min(total_layout - (lines - 1), self.scroll)); + self.scroll = cmp::max(0, cmp::min(total_layout - lines, self.scroll)); } pub fn layout_cursor(&self, cursor: &Cursor) -> LayoutCursor {