branch: externals/topspace
commit c326169190bac3737a33e5110c1a77a7842e38f5
Author: Trevor Pogue <trevorpo...@gmail.com>
Commit: GitHub <nore...@github.com>

    Fix inability to use scrolling commands interactively (#11)
---
 .gitignore  | 1 +
 topspace.el | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..54450dd53a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.~undo-tree~
\ No newline at end of file
diff --git a/topspace.el b/topspace.el
index ba5b272d5c..c8813cd308 100644
--- a/topspace.el
+++ b/topspace.el
@@ -216,9 +216,10 @@ TOTAL-LINES is used in the same way as in `scroll-down'."
 (defun topspace--filter-args-scroll-down (&optional total-lines)
   "Run before `scroll-down' for scrolling above the top line.
 TOTAL-LINES is used in the same way as in `scroll-down'."
+  (setq total-lines (car total-lines))
   (cond
    ((not (topspace--enabled)) total-lines)
-   ((setq total-lines (car total-lines))
+   (t
     (setq total-lines (or total-lines (- (topspace--window-height)
                                          next-screen-context-lines)))
     (setq topspace--total-lines-scrolling total-lines)
@@ -227,9 +228,10 @@ TOTAL-LINES is used in the same way as in `scroll-down'."
 (defun topspace--filter-args-scroll-up (&optional total-lines)
   "Run before `scroll-up' for scrolling above the top line.
 TOTAL-LINES is used in the same way as in `scroll-up'."
+  (setq total-lines (car total-lines))
   (cond
    ((not (topspace--enabled)) total-lines)
-   ((setq total-lines (car total-lines))
+   (t
     (setq total-lines (* (or total-lines (- (topspace--window-height)
                                             next-screen-context-lines)) -1))
     (setq topspace--total-lines-scrolling total-lines)

Reply via email to