[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/topspace be86d5ba9b 180/181: Prevent line `1` indicator
From: |
ELPA Syncer |
Subject: |
[elpa] externals/topspace be86d5ba9b 180/181: Prevent line `1` indicator sometimes displaying too high in `linum-mode` (#22) |
Date: |
Tue, 23 Aug 2022 12:58:49 -0400 (EDT) |
branch: externals/topspace
commit be86d5ba9b020ae62322bec2a006f4d0ef749773
Author: Trevor Pogue <trevorpogue@gmail.com>
Commit: GitHub <noreply@github.com>
Prevent line `1` indicator sometimes displaying too high in `linum-mode`
(#22)
With linum-mode enabled, the line 1 indicator in the left margin would
sometimes
show too high up, above the actual line 1.
The issue would occur when scrolling and topspace-height was zero before
scrolling
but greater than zero after scrolling. This prevents the issue.
---
Cask | 3 ++-
test/test-helper.el | 1 +
test/topspace-test.el | 9 ++++++++-
topspace.el | 4 +++-
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/Cask b/Cask
index 841656189c..d0748fb1bf 100644
--- a/Cask
+++ b/Cask
@@ -4,6 +4,7 @@
(development
(depends-on "undercover")
(depends-on "buttercup")
- (depends-on "smooth-scrolling"))
+ (depends-on "smooth-scrolling")
+ (depends-on "linum"))
(package-file "topspace.el")
diff --git a/test/test-helper.el b/test/test-helper.el
index e59761bf66..1651426629 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -15,6 +15,7 @@
))
(require 'smooth-scrolling)
+(require 'linum)
(require 'topspace)
;;; test-helper.el ends here
diff --git a/test/topspace-test.el b/test/topspace-test.el
index 3670a198ca..850b95ff9a 100644
--- a/test/topspace-test.el
+++ b/test/topspace-test.el
@@ -83,11 +83,18 @@
(describe
"topspace--after-scroll"
(it "is needed when first scrolling above the top line"
+ (linum-mode 1)
(goto-char 1)
(topspace-set-height 0)
(scroll-up-line)
(scroll-down 2)
- (expect (round (topspace-height)) :to-equal 1)))
+ (linum-mode -1)
+ (goto-char 1)
+ (topspace-set-height 0)
+ (scroll-up-line)
+ (scroll-down 2)
+ (expect (round (topspace-height)) :to-equal 1)
+ ))
(describe
"topspace--window-configuration-change"
diff --git a/topspace.el b/topspace.el
index ec2fa02f73..9fac1d3057 100644
--- a/topspace.el
+++ b/topspace.el
@@ -420,7 +420,9 @@ command is run in the described case above."
1 topspace--window-start-before-scroll)))
(setq total-lines (abs total-lines))
(set-window-start (selected-window) 1)
- (topspace-set-height (- total-lines lines-already-scrolled)))))))
+ (topspace-set-height (- total-lines lines-already-scrolled)))
+ (when (and (bound-and-true-p linum-mode) (fboundp 'linum-update-window))
+ (linum-update-window (selected-window)))))))
(defun topspace--after-recenter (&optional line-offset redisplay)
"Recenter near the top of buffers by adding top space appropriately.
- [elpa] externals/topspace 50ca92c72d 152/181: Update cached coveralls badge, (continued)
- [elpa] externals/topspace 50ca92c72d 152/181: Update cached coveralls badge, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace ce7fc98008 153/181: Internal refactoring, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 86127bf20f 160/181: Performance optimization, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 543f835124 163/181: Set NEWS version head back to Unreleased, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 6f5d60ea36 166/181: Update NEWS.md, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace dd7d35b52d 168/181: Fix links in CONTRIBUTING.md, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 6692cd1346 169/181: Performance optimization, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace bb73278f40 170/181: Update description, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 9dd0ce4d42 172/181: Update description, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace d364f55550 173/181: Update description, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace be86d5ba9b 180/181: Prevent line `1` indicator sometimes displaying too high in `linum-mode` (#22),
ELPA Syncer <=
- [elpa] externals/topspace ccc5c23731 176/181: Update description, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 0399f73f9b 179/181: Update description, ELPA Syncer, 2022/08/23