Function: evil-scroll-down

evil-scroll-down is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-scroll-down COUNT)

Documentation

Scroll the window and the cursor COUNT lines downwards.

If COUNT is not specified the function scrolls down evil-scroll-count lines, which is the last used count. If the scroll count is zero the command scrolls half the screen.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-command evil-scroll-down (count)
  "Scroll the window and the cursor COUNT lines downwards.
If COUNT is not specified the function scrolls down
`evil-scroll-count' lines, which is the last used count.
If the scroll count is zero the command scrolls half the screen."
  :repeat nil
  :keep-visual t
  (interactive "<c>")
  (when (= (line-end-position) (point-max))
    (signal 'end-of-buffer nil))
  (setq count (evil--get-scroll-count count))
  (evil-ensure-column
    ;; BUG #660: First check whether the eob is visible.
    ;; In that case we do not scroll but merely move point.
    (if (<= (point-max) (window-end))
        (vertical-motion count)
      (condition-case nil
          (let ((scroll-preserve-screen-position 'always)
                (last-command (when (eq real-last-command real-this-command)
                                real-last-command)))
            (scroll-up count))
        (:success
         ;; If EOB became visible: Scroll it to the bottom
         (save-excursion
           (goto-char (window-start))
           (vertical-motion (max 0 (- (window-height) 1 scroll-margin)))
           (when (<= (point-max) (point)) (recenter -1))))
        (end-of-buffer (goto-char (point-max)) (recenter -1))))))