Buffer: fix max scroll going one line beyond end

This commit is contained in:
Jeremy Soller 2023-11-30 14:51:22 -07:00
parent 1cf36f8a5d
commit afc5b525f1
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -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 {