diff options
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -695,6 +695,14 @@ void buffer_scroll(TextBuffer *buffer, double dx, double dy) { buffer_correct_scroll(buffer); } +void buffer_page_up(TextBuffer *buffer, i64 npages) { + buffer_scroll(buffer, 0, (double)(-npages * buffer_display_lines(buffer))); +} + +void buffer_page_down(TextBuffer *buffer, i64 npages) { + buffer_scroll(buffer, 0, (double)(+npages * buffer_display_lines(buffer))); +} + // returns the position of the character at the given position in the buffer. v2 buffer_pos_to_pixels(TextBuffer *buffer, BufferPos pos) { u32 line = pos.line, index = pos.index; |