vim: Fix ctrl-d/u going to top bottom (#14620)

Release Notes:

- vim: Fixed ctrl-d/ctrl-u getting to top/bottom of buffer (#13250)
This commit is contained in:
Conrad Irwin 2024-07-16 22:56:44 -06:00 committed by GitHub
parent acc9c2421b
commit 33f68882c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 76 additions and 52 deletions

View file

@ -476,7 +476,10 @@ impl Editor {
}
let cur_position = self.scroll_position(cx);
let new_pos = cur_position + point(0., amount.lines(self));
let Some(visible_line_count) = self.visible_line_count() else {
return;
};
let new_pos = cur_position + point(0., amount.lines(visible_line_count));
self.set_scroll_position(new_pos, cx);
}