Skip to content

Commit

Permalink
improve zoom when both beginning and end of buffer are visible
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Aug 30, 2024
1 parent dcbb891 commit 1968cd1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rigpa-view-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@
Point is reset upon View mode exit, so this is 'virtual' in the sense
that it is only in effect within View mode to indicate the position in
reference to which we are zooming."
(cond ((pos-visible-in-window-p (point-min))
(move-to-window-line 0))
((pos-visible-in-window-p (point-max))
(move-to-window-line -1))
(t (move-to-window-line nil))))
(let ((bob-visible (pos-visible-in-window-p (point-min)))
(eob-visible (pos-visible-in-window-p (point-max))))
(cond ((and bob-visible eob-visible) (move-to-window-line nil))
(bob-visible (move-to-window-line 0))
(eob-visible (move-to-window-line -1))
(t (move-to-window-line nil)))))

(defun rigpa-view-zoom-in ()
"Zoom in"
Expand Down

0 comments on commit 1968cd1

Please sign in to comment.