We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60fd0a7 commit 5792cd7Copy full SHA for 5792cd7
good-scroll.el
@@ -165,8 +165,11 @@ and shouldn't be run normally."
165
166
(defun good-scroll--point-at-top-p ()
167
"Return non-nil if the point is close to the top of the selected window."
168
- (<= (line-number-at-pos (point) t)
169
- (1+ (line-number-at-pos (window-start) t))))
+ (save-restriction
+ ;; Widen in case the window start is outside the visible part of the buffer
170
+ (widen)
171
+ (<= (line-number-at-pos (point) t)
172
+ (1+ (line-number-at-pos (window-start) t)))))
173
174
(defun good-scroll--advice-line-move (line-move &rest args)
175
"Call LINE-MOVE with ARGS, but avoid resetting the vscroll.
0 commit comments