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

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

[elpa] externals/topspace 6692cd1346 169/181: Performance optimization


From: ELPA Syncer
Subject: [elpa] externals/topspace 6692cd1346 169/181: Performance optimization
Date: Tue, 23 Aug 2022 12:58:48 -0400 (EDT)

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

    Performance optimization
    
    - Add extra condition in `topspace--post-command` before executing
      `beginning-of-visual-line`, which can be time consuming
    - Update comment in `topspace--text` to reflect the fact that
      it is likely intentional that `line-height` cannot be set to less
                    than 1.0 as opposed to it being a bug.
---
 topspace.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/topspace.el b/topspace.el
index e890083e4e..8020e0d09a 100644
--- a/topspace.el
+++ b/topspace.el
@@ -614,10 +614,9 @@ If that doesn't work it uses `topspace--count-lines-slow'."
   (cond
    ((= (round height) 0) "")
    ((= (round height) 1)
-    ;; comment a) It seems there is a bug in Emacs where you cannot set a
-    ;; string's line-height to a positive float less than 1.  So in this
-    ;; condition, settle for rounding the top space height up to 1
-    ;; TODO: open issue with Emacs devel mailing list for this
+    ;; comment a) You cannot set a string's line-height
+    ;; to a positive float less than 1.  So in this condition,
+    ;; settle for rounding the top space height up to 1
     "\n")
    (t
     ;; set the text to a series of newline characters with the last line
@@ -691,7 +690,8 @@ ARG defaults to 1."
 
 (defun topspace--post-command ()
   "Reduce top space height before the cursor can move past `window-end'."
-  (when (= topspace--pre-command-window-start 1)
+  (when (and (= topspace--pre-command-window-start 1)
+             (> (point) topspace--pre-command-point))
     (let ((next-line-point))
       (save-excursion
         (goto-char topspace--pre-command-point)



reply via email to

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