[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/topspace 86127bf20f 160/181: Performance optimization
From: |
ELPA Syncer |
Subject: |
[elpa] externals/topspace 86127bf20f 160/181: Performance optimization |
Date: |
Tue, 23 Aug 2022 12:58:47 -0400 (EDT) |
branch: externals/topspace
commit 86127bf20f241a3c421b13523f0de6590fe42055
Author: Trevor Pogue <poguete@mcmaster.ca>
Commit: Trevor Pogue <poguete@mcmaster.ca>
Performance optimization
- Improve performance of `topspace--post-command` by also only counting
lines
when point moved past previous line
---
topspace.el | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/topspace.el b/topspace.el
index b1a6329372..23debe26cc 100644
--- a/topspace.el
+++ b/topspace.el
@@ -691,17 +691,24 @@ ARG defaults to 1."
(defun topspace--post-command ()
"Reduce top space height before the cursor can move past `window-end'."
- (when (and (= topspace--pre-command-window-start 1)
- (> (point) topspace--pre-command-point)
+ (when (= topspace--pre-command-window-start 1)
+ (let ((next-line-point))
+ (save-excursion
+ (goto-char topspace--pre-command-point)
+ (vertical-motion 1)
+ (beginning-of-visual-line)
+ (setq next-line-point (point)))
+ (when (and
+ (>= (point) next-line-point)
(< (- (line-number-at-pos (point))
(line-number-at-pos topspace--pre-command-point))
(window-text-height)))
- (let ((topspace-height (topspace-height)) (total-lines-past-max))
- (when (> topspace-height 0)
- (setq total-lines-past-max (topspace--total-lines-past-max
- topspace-height))
- (when (> total-lines-past-max 0)
- (topspace--decrease-height total-lines-past-max)))))
+ (let ((topspace-height (topspace-height)) (total-lines-past-max))
+ (when (> topspace-height 0)
+ (setq total-lines-past-max (topspace--total-lines-past-max
+ topspace-height))
+ (when (> total-lines-past-max 0)
+ (topspace--decrease-height total-lines-past-max)))))))
(when (and (= (window-start) 1)
topspace--got-first-window-configuration-change)
(topspace-set-height)))
- [elpa] externals/topspace 1bfa4d1b28 135/181: Update Changelog, (continued)
- [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, 2022/08/23
- [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 <=
- [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, 2022/08/23
- [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