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

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

[elpa] externals/topspace ba275f7c94 119/181: Fix off-by-one-line scroll


From: ELPA Syncer
Subject: [elpa] externals/topspace ba275f7c94 119/181: Fix off-by-one-line scroll bug at top of buffer introduced in #10
Date: Tue, 23 Aug 2022 12:58:40 -0400 (EDT)

branch: externals/topspace
commit ba275f7c944738b1db839516dff1c4e97edb868b
Author: Trevor Pogue <poguete@mcmaster.ca>
Commit: Trevor Pogue <poguete@mcmaster.ca>

    Fix off-by-one-line scroll bug at top of buffer introduced in #10
    
    - The buffer would get scrolled up too far by one line when scrolling
      text up in the following condition: top space was present before
      scrolling but not present after, and the top line in the buffer should
      be at the very top of the window after (but the bug made the second line
      be at the top of the window). This is resolved here.
    - The technical reason for the bug was that 0.0 would be passed to 
`scroll-up`
      after `topspace--filter-args-scroll-up`, assuming that `scroll-up` would 
not
      scroll in this scenario, however it turns out that if
      `scroll-up`/`scroll-down` are passed a zero-valued float they will
      still scroll by one line.
---
 topspace.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/topspace.el b/topspace.el
index 713f59c78b..dffc299d43 100644
--- a/topspace.el
+++ b/topspace.el
@@ -211,7 +211,7 @@ TOTAL-LINES is used in the same way as in `scroll-down'."
     (topspace--draw new-topspace-height)
     (setq total-lines
           (- total-lines (- new-topspace-height old-topspace-height)))
-    (if (display-graphic-p) total-lines (round total-lines))))
+    (round total-lines)))
 
 (defun topspace--filter-args-scroll-down (&optional total-lines)
   "Run before `scroll-down' for scrolling above the top line.



reply via email to

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