File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1043,7 +1043,7 @@ If the scroll count is zero the command scrolls half the screen."
1043
1043
(when (= (point-min ) (line-beginning-position ))
1044
1044
(signal 'beginning-of-buffer nil ))
1045
1045
(when (zerop count)
1046
- (setq count (/ (window-body -height ) 2 )))
1046
+ (setq count (/ (evil- window-visible -height) 2 )))
1047
1047
(let ((xy (evil-posn-x-y (posn-at-point ))))
1048
1048
(condition-case nil
1049
1049
(progn
@@ -1067,7 +1067,7 @@ If the scroll count is zero the command scrolls half the screen."
1067
1067
(setq evil-scroll-count count)
1068
1068
(when (eobp ) (signal 'end-of-buffer nil ))
1069
1069
(when (zerop count)
1070
- (setq count (/ (window-body -height ) 2 )))
1070
+ (setq count (/ (evil- window-visible -height) 2 )))
1071
1071
; ; BUG #660: First check whether the eob is visible.
1072
1072
; ; In that case we do not scroll but merely move point.
1073
1073
(if (<= (point-max ) (window-end ))
Original file line number Diff line number Diff line change @@ -3980,6 +3980,21 @@ PROPERTIES is a property-list which supports the following properties:
3980
3980
(evil-motion-state))
3981
3981
(switch-to-buffer-other-window buf))))
3982
3982
3983
+ ; ;; Window
3984
+
3985
+ (defun evil-window-visible-height (&optional window )
3986
+ " The visible height of WINDOW in lines.
3987
+
3988
+ If no WINDOW is specified, use the selected one."
3989
+ (let ((window (or window (selected-window ))))
3990
+ (save-window-excursion
3991
+ (select-window window)
3992
+ (let ((window-top (save-excursion (move-to-window-line 0 )
3993
+ (line-number-at-pos )))
3994
+ (window-bottom (save-excursion (move-to-window-line -1 )
3995
+ (line-number-at-pos ))))
3996
+ (- window-bottom window-top)))))
3997
+
3983
3998
(provide 'evil-common )
3984
3999
3985
4000
; ;; evil-common.el ends here
You can’t perform that action at this time.
0 commit comments