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

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

[elpa] externals/company dde921a839: Fix some test failures


From: ELPA Syncer
Subject: [elpa] externals/company dde921a839: Fix some test failures
Date: Tue, 21 Nov 2023 18:57:41 -0500 (EST)

branch: externals/company
commit dde921a83912a055b09c193d29f499910efb1cd8
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    Fix some test failures
    
    In "interactive-only" tests.
---
 company.el              | 9 +++++----
 test/frontends-tests.el | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/company.el b/company.el
index f443e1c497..a2f5dd5565 100644
--- a/company.el
+++ b/company.el
@@ -3003,7 +3003,7 @@ from the candidates list.")
               (setq from-chars (point)))
 
             (if (= from-chars (point-max))
-                (if to
+                (if (and to (> to from))
                     (propertize " " 'display `(space . (:width (,(- to 
from)))))
                   "")
               (if (not to)
@@ -3714,7 +3714,7 @@ but adjust the expected values appropriately."
                (str (car item))
                (annotation (cadr item))
                (left (nth 2 item))
-               (right (company--right-margin))
+               (right (company--right-margin limit len))
                (width width)
                (selected (equal selection i)))
           (when company-show-quick-access
@@ -3759,10 +3759,11 @@ but adjust the expected values appropriately."
                     'company-tooltip-scrollbar-thumb
                   'company-tooltip-scrollbar-track))))
 
-(defun company--right-margin ()
+(defun company--right-margin (limit length)
   (if (or (not (eq company-tooltip-offset-display 'scrollbar))
           (not (display-graphic-p))
-          (= company-tooltip-scrollbar-width 1))
+          (= company-tooltip-scrollbar-width 1)
+          (<= length limit))
       (company-space-string company-tooltip-margin)
     (let* ((scroll-width (ceiling (* (default-font-width)
                                      company-tooltip-scrollbar-width)))
diff --git a/test/frontends-tests.el b/test/frontends-tests.el
index cab9e94d87..3486943f5c 100644
--- a/test/frontends-tests.el
+++ b/test/frontends-tests.el
@@ -315,6 +315,7 @@
 
 (ert-deftest company-create-lines-with-multiple-width-and-keep-prefix ()
   :tags '(interactive)
+  ;; XXX: Likewise brittle with '-nw'.
   (let* (company-show-quick-access
          (company-candidates '("MIRAI発売1カ月"
                                "MIRAI発売2カ月"))



reply via email to

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