[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/topspace d3182133f9 144/181: Increase test coverage
From: |
ELPA Syncer |
Subject: |
[elpa] externals/topspace d3182133f9 144/181: Increase test coverage |
Date: |
Tue, 23 Aug 2022 12:58:45 -0400 (EDT) |
branch: externals/topspace
commit d3182133f9a4d775fe550fcf958c1c37de29a839
Author: Trevor Pogue <poguete@mcmaster.ca>
Commit: Trevor Pogue <poguete@mcmaster.ca>
Increase test coverage
---
README.md | 2 +-
topspace.el | 14 ++++++--------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 3d3b30d24e..f260bc4bc4 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
<p align="center">
<a
href="https://github.com/trevorpogue/topspace/actions/workflows/test.yml/"><img
src="https://github.com/trevorpogue/topspace/actions/workflows/test.yml/badge.svg"
height="20"/></a>
- <a href='https://coveralls.io/github/trevorpogue/topspace?branch=main'><img
src='https://coveralls.io/repos/github/trevorpogue/topspace/badge.svg?branch=main'
alt='Coverage Status' /></a>
+ <a href='https://coveralls.io/github/trevorpogue/topspace?branch=main'><img
src='https://coveralls.io/repos/github/trevorpogue/topspace/badge.svg?branch=main?'
alt='Coverage Status' /></a>
<a href="http://melpa.org/#/topspace"><img
src="http://melpa.org/packages/topspace-badge.svg" height="20"/></a>
<a href="http://stable.melpa.org/#/topspace"><img
src="http://stable.melpa.org/packages/topspace-badge.svg" height="20"/></a>
</p>
diff --git a/topspace.el b/topspace.el
index bf14618973..1e010febd5 100644
--- a/topspace.el
+++ b/topspace.el
@@ -373,10 +373,9 @@ which must be accounted for in the calling functions."
(setq result (+ result (* (vertical-motion 1) (line-pixel-height))))))
result))
-(defun topspace--count-lines-slower (start end)
+(defun topspace--cnt-ln-slow (start end)
"Return screen lines between points START and END.
-Like `count-screen-lines' except `count-screen-lines' will
-return unexpected value when END is in column 0. This fixes that issue."
+Like `topspace--count-lines' but is a slower backup alternative."
(/ (topspace--count-pixel-height start end) (float (default-line-height))))
(defun topspace--count-lines (start end)
@@ -385,7 +384,7 @@ Like `count-screen-lines' except `count-screen-lines' will
return unexpected value when END is in column 0. This fixes that issue.
This function also tries to first count the lines using a potentially faster
technique involving `window-absolute-pixel-position'.
-If that doesn't work it uses `topspace--count-lines-slower'."
+If that doesn't work it uses `topspace--cnt-ln-slow'."
(let ((old-end end) (old-start start))
(setq end (min end (- (window-end) 1)))
(setq start (max start (window-start)))
@@ -396,12 +395,11 @@ If that doesn't work it uses
`topspace--count-lines-slower'."
;; first try counting lines by getting the pixel difference
;; between end and start and dividing by `default-line-height'
(+ (/ (- (cdr end-y) (cdr start-y)) (float (default-line-height)))
- (if (> old-end end) (topspace--count-lines-slower end old-end) 0)
- (if (< old-start start)
- (topspace--count-lines-slower old-start start) 0)))
+ (if (> old-end end) (topspace--cnt-ln-slow end old-end) 0)
+ (if (< old-start start) (topspace--cnt-ln-slow old-start start) 0)))
(t ;; if the pixel method above doesn't work do this slower method
;; (it won't work if either START or END are not visible in window)
- (topspace--count-lines-slower start old-end))))))
+ (topspace--cnt-ln-slow start old-end))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Overlay drawing
- [elpa] externals/topspace c5b424788f 116/181: Update Changelog, (continued)
- [elpa] externals/topspace c5b424788f 116/181: Update Changelog, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 9760a3ab5e 123/181: Update Changelog, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 2c8440f5de 124/181: Add support for `smooth-scrolling` package (#14), ELPA Syncer, 2022/08/23
- [elpa] externals/topspace d346f7b5e0 131/181: Update README.md, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 2f35223b78 132/181: Fix unexpected top space height change when echo area height changes (#18), ELPA Syncer, 2022/08/23
- [elpa] externals/topspace ca7eb6b94a 133/181: Update Changelog, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 1bfa4d1b28 135/181: Update Changelog, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace e7df37fd99 139/181: Add section links to readme, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 15ac6c969a 141/181: Internal optimizations and refactoring, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 7741d88dca 140/181: Increase test coverage, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace d3182133f9 144/181: Increase test coverage,
ELPA Syncer <=
- [elpa] externals/topspace 186ea6091a 148/181: Internal optimizations and refactoring, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace bc35cd92d5 149/181: Update test.yml, ELPA Syncer, 2022/08/23
- [elpa] externals/topspace 5c2b095a13 150/181: Update cached coveralls badge, ELPA Syncer, 2022/08/23
- [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