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

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

[elpa] externals/company a986091380 20/30: Fix test failures


From: ELPA Syncer
Subject: [elpa] externals/company a986091380 20/30: Fix test failures
Date: Sat, 13 Jul 2024 00:57:52 -0400 (EDT)

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

    Fix test failures
    
    #1106 #340
---
 company.el              | 5 +++--
 test/frontends-tests.el | 8 ++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/company.el b/company.el
index a8b6416aae..4e94becd99 100644
--- a/company.el
+++ b/company.el
@@ -2452,10 +2452,11 @@ For more details see `company-insertion-on-trigger' and
                     (company-call-backend 'ignore-case))))
 
 (defun company--boundaries (&optional candidate)
+  (unless candidate
+    (setq candidate (nth (or company-selection 0) company-candidates)))
   (or
    (company-call-backend 'adjust-boundaries
-                         (or candidate
-                             (nth (or company-selection 0) company-candidates))
+                         candidate
                          company-prefix company-suffix)
    (and
     ;; Default to replacing the suffix only if the completion ends with it.
diff --git a/test/frontends-tests.el b/test/frontends-tests.el
index 54db7654d8..ac084e8281 100644
--- a/test/frontends-tests.el
+++ b/test/frontends-tests.el
@@ -32,7 +32,7 @@
             (company-begin-commands '(self-insert-command))
             (company-backends
              (list (lambda (c &rest _)
-                     (cl-case c (prefix "") (candidates '("a" "b" "c")))))))
+                     (cl-case c (prefix '("" "")) (candidates '("a" "b" 
"c")))))))
         (let (this-command)
           (company-call 'complete))
         (company-call 'open-line 1)
@@ -102,7 +102,8 @@
       (set-window-buffer nil (current-buffer))
       (save-excursion (insert "\n"))
       (let ((company-backend #'ignore)
-            (company-prefix ""))
+            (company-prefix "")
+            (company-suffix ""))
         (company-preview-show-at-point (point) "123")
         (let* ((ov company-preview-overlay)
                (str (overlay-get ov 'after-string)))
@@ -250,18 +251,21 @@
          (company-tooltip-margin 1)
          (company-backend #'ignore))
     (let* ((company-common (make-string (- ww 3) ?1))
+           (company-suffix "")
            (company-candidates `(,(concat company-common "2")
                                  ,(concat company-common "3"))))
       (should (equal (list (format " %s2 " (make-string (- ww 3) ?1))
                            (format " %s3 " (make-string (- ww 3) ?1)))
                      (cdr (company--create-lines 0 999)))))
     (let* ((company-common (make-string (- ww 2) ?1))
+           (company-suffix "")
            (company-candidates `(,(concat company-common "2")
                                  ,(concat company-common "3"))))
       (should (equal (list (format " %s " company-common)
                            (format " %s " company-common))
                      (cdr (company--create-lines 0 999)))))
     (let* ((company-common (make-string ww ?1))
+           (company-suffix "")
            (company-candidates `(,(concat company-common "2")
                                  ,(concat company-common "3")))
            (res (cdr (company--create-lines 0 999))))



reply via email to

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