Fix ctrl-d/u issues with scroll_beyond_last_line off (#15395)

Closes #15356

Release Notes:

- vim: Fixed issues with `ctrl-d`/`ctrl-u` when
`scroll_beyond_last_line` is set to `off`
([#15356](https://github.com/zed-industries/zed/issues/15356)).


https://github.com/user-attachments/assets/d3166393-4a4e-4195-9db6-3ff1d4aeec78

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Kevin Sweet 2024-08-23 08:34:40 -06:00 committed by GitHub
parent 518dd3ed3a
commit 5e869dadf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 73 additions and 25 deletions

View file

@ -505,7 +505,7 @@ impl Editor {
}
if let Some(visible_lines) = self.visible_line_count() {
if newest_head.row() < DisplayRow(screen_top.row().0 + visible_lines as u32) {
if newest_head.row() <= DisplayRow(screen_top.row().0 + visible_lines as u32) {
return Ordering::Equal;
}
}