diff options
| author | Tom Dalziel <tom_dl@hotmail.com> | 2021-07-23 15:33:32 +0100 |
|---|---|---|
| committer | Tom Dalziel <tom_dl@hotmail.com> | 2021-07-23 15:33:32 +0100 |
| commit | 32058519bedc482ad62870a15b68a4be00b75e47 (patch) | |
| tree | c6a01b3be5775410e1670d7052131466c6e40f54 | |
| parent | 5201f5cf5a4870e081d09bc3113a55cb94f3812f (diff) | |
Revert "Scroll half of the visible screen respecting zoom level (#1490)"
This reverts commit 070abb16620653fb343980fb85a13c4d55e1070b.
As noted in #1497 this introduced bugs which imo are worse than the
bug this commit aims to solve. More work needed.
| -rw-r--r-- | evil-commands.el | 4 | ||||
| -rw-r--r-- | evil-common.el | 15 |
2 files changed, 2 insertions, 17 deletions
diff --git a/evil-commands.el b/evil-commands.el index 7bd93bc..ac88186 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -1043,7 +1043,7 @@ If the scroll count is zero the command scrolls half the screen." (when (= (point-min) (line-beginning-position)) (signal 'beginning-of-buffer nil)) (when (zerop count) - (setq count (/ (evil-window-visible-height) 2))) + (setq count (/ (window-body-height) 2))) (let ((xy (evil-posn-x-y (posn-at-point)))) (condition-case nil (progn @@ -1067,7 +1067,7 @@ If the scroll count is zero the command scrolls half the screen." (setq evil-scroll-count count) (when (eobp) (signal 'end-of-buffer nil)) (when (zerop count) - (setq count (/ (evil-window-visible-height) 2))) + (setq count (/ (window-body-height) 2))) ;; 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)) diff --git a/evil-common.el b/evil-common.el index 847bae9..b68e1ca 100644 --- a/evil-common.el +++ b/evil-common.el @@ -3980,21 +3980,6 @@ PROPERTIES is a property-list which supports the following properties: (evil-motion-state)) (switch-to-buffer-other-window buf)))) -;;; Window - -(defun evil-window-visible-height (&optional window) - "The visible height of WINDOW in lines. - -If no WINDOW is specified, use the selected one." - (let ((window (or window (selected-window)))) - (save-window-excursion - (select-window window) - (let ((window-top (save-excursion (move-to-window-line 0) - (line-number-at-pos))) - (window-bottom (save-excursion (move-to-window-line -1) - (line-number-at-pos)))) - (- window-bottom window-top))))) - (provide 'evil-common) ;;; evil-common.el ends here |
