Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion source/mode/document.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ Important pieces of functionality are:
"pageup" 'scroll-page-up
"C-f" 'scroll-page-down
"space" 'scroll-page-down
"pagedown" 'scroll-page-down)))))
"pagedown" 'scroll-page-down
"C-d" 'scroll-half-page-down
"C-u" 'scroll-half-page-up)))))

(define-configuration document-buffer
((default-modes (cons 'document-mode %slot-value%))))
Expand Down Expand Up @@ -295,6 +297,14 @@ The amount scrolled is determined by the buffer's `horizontal-scroll-distance'."
(ps-eval (ps:chain window (scroll-by 0 (- (* (ps:lisp (page-scroll-ratio (current-buffer)))
(ps:@ window inner-height)))))))

(define-command scroll-half-page-down ()
"Scroll down by half a page height."
(ps-eval (ps:chain window (scroll-by 0 (/ (ps:@ window inner-height) 2)))))

(define-command scroll-half-page-up ()
"Scroll up by half a page height."
(ps-eval (ps:chain window (scroll-by 0 (- (/ (ps:@ window inner-height) 2))))))

(define-command zoom-page (&key (buffer (current-buffer)))
"Zoom in the current buffer."
(incf (ffi-buffer-zoom-ratio buffer) (zoom-ratio-step buffer)))
Expand Down