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

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

[elpa] master 946c798 095/173: Handle empty list of candidates


From: Dmitry Gutov
Subject: [elpa] master 946c798 095/173: Handle empty list of candidates
Date: Thu, 23 Jun 2016 00:28:41 +0000 (UTC)

branch: master
commit 946c798dfc19047ae3cebe63d00db84ec525a9bc
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Handle empty list of candidates
---
 company.el         |    2 +-
 test/core-tests.el |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/company.el b/company.el
index 8d416de..498920a 100644
--- a/company.el
+++ b/company.el
@@ -1239,7 +1239,7 @@ can retrieve meta-data for them."
           (push anno2 annos)
           (push str res)            ; Maintain ordering.
           (setq str str2)))))
-    (push str res)
+    (when str (push str res))
     (nreverse res)))
 
 (defun company--transform-candidates (candidates)
diff --git a/test/core-tests.el b/test/core-tests.el
index dcadfd3..46d1709 100644
--- a/test/core-tests.el
+++ b/test/core-tests.el
@@ -399,6 +399,9 @@
       (and (ert-equal-including-properties (car list1) (car list2))
            (ct-equal-including-properties (cdr list1) (cdr list2)))))
 
+(ert-deftest company-strips-duplicates-returns-nil ()
+  (should (null (company--preprocess-candidates nil))))
+
 (ert-deftest company-strips-duplicates-within-groups ()
   (let* ((kvs '(("a" . "b")
                 ("a" . nil)



reply via email to

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