- (> (count-screen-lines (min (point) beacon--previous-place)
- (max (point) beacon--previous-place))
- delta)))
+ ;; Check if the movement was >= DELTA lines by moving DELTA
+ ;; lines. `count-screen-lines' is too slow if the movement had
+ ;; thousands of lines.
+ (save-excursion
+ (let ((p (point)))
+ (goto-char (min beacon--previous-place p))
+ (vertical-motion delta)
+ (> (max p beacon--previous-place)
+ (line-beginning-position))))))