branch: externals/topspace commit 3fa532a34324da2e3256d521bf8feca2183148ed Author: Trevor Pogue <pogu...@mcmaster.ca> Commit: Trevor Pogue <pogu...@mcmaster.ca>
Fix terminal bug from PR #10 - PR #10 introduced a bug where scrolling doesn't working as expected when Emacs is run in terminal. The fix for this in the previous commit was not sufficient. This commit fixes the source of the problem, which was that floats were being passed to scroll-up/scroll-down from the added advice functions, but that seems to be invalid when in terminal. So now only integers are being passed to scroll-up/scroll-down when in terminal. --- topspace.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/topspace.el b/topspace.el index bee193ba24..cca8595623 100644 --- a/topspace.el +++ b/topspace.el @@ -209,7 +209,9 @@ TOTAL-LINES is used in the same way as in `scroll-down'." (+ old-topspace-height total-lines))) (setq topspace--window-start-before-scroll (window-start)) (topspace--draw new-topspace-height) - (- total-lines (- new-topspace-height old-topspace-height)))) + (setq total-lines + (- total-lines (- new-topspace-height old-topspace-height))) + (if (display-graphic-p) total-lines (round total-lines)))) (defun topspace--filter-args-scroll-down (&optional total-lines) "Run before `scroll-down' for scrolling above the top line. @@ -360,9 +362,7 @@ or if the selected window is in a child-frame." (defun topspace--window-height () "Return the number of screen lines in the selected window rounded up." - (if (display-graphic-p) - (float (floor (window-screen-lines))) - (floor (window-screen-lines)))) + (float (floor (window-screen-lines)))) (defun topspace--count-pixel-height (start end) "Return total pixels between points START and END as if they're both visible."