emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/topspace 3fa532a343 100/181: Fix terminal bug from PR #


From: ELPA Syncer
Subject: [elpa] externals/topspace 3fa532a343 100/181: Fix terminal bug from PR #10
Date: Tue, 23 Aug 2022 12:58:38 -0400 (EDT)

branch: externals/topspace
commit 3fa532a34324da2e3256d521bf8feca2183148ed
Author: Trevor Pogue <poguete@mcmaster.ca>
Commit: Trevor Pogue <poguete@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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]