diff --git a/evil-commands.el b/evil-commands.el index 2e3a26a2..8c29db41 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -254,7 +254,14 @@ of the current screen line." :type line (evil-ensure-column (if (null count) - (goto-char (point-max)) + (progn + (goto-char (point-max)) + (when (and (eq (current-buffer) (window-buffer)) + (> (point) (window-end nil t))) + ;; If the end of the buffer is not already on the screen, scroll in + ;; a special way to position it near the bottom. + (overlay-recenter (point)) + (recenter -1))) (goto-char (point-min)) (forward-line (1- count)))))