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

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

[ELPA-diffs] [elpa] 13/14: Fix a broken test, remove a duplicate one


From: emacs-devel
Subject: [ELPA-diffs] [elpa] 13/14: Fix a broken test, remove a duplicate one
Date: Tue, 14 Jan 2014 20:57:14 +0000

This is an automated email from the git hooks/post-receive script.

root pushed a commit to branch master
in repository elpa.

commit 67a96dbbfe645b64291ed62eab6f1eb391a834e0
Author: Dmitry Gutov <address@hidden>
Date:   Tue Jan 14 15:20:59 2014 +0200

    Fix a broken test, remove a duplicate one
---
 company-tests.el |   18 ++----------------
 company.el       |   14 +++++++-------
 2 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/company-tests.el b/company-tests.el
index b111822..e9116b2 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -166,6 +166,7 @@
   (with-temp-buffer
     (company-mode)
     (let (company-frontends
+          company-end-of-buffer-workaround
           (company-backends
            (list (lambda (command &optional arg)
                    (case command
@@ -177,7 +178,7 @@
         (company-complete))
       (should (string= "ab" (buffer-string)))
       (delete-char -2)
-      (insert "AB") ; hack, to keep it in one test
+      (insert "A") ; hack, to keep it in one test
       (company-complete-selection)
       (should (string= "abcd" (buffer-string))))))
 
@@ -210,21 +211,6 @@
                      (candidates '("tea-cup" "teal-color")))))))
       (let (this-command)
         (company-complete))
-      (should (string= "tc" (buffer-string))))))
-
-(ert-deftest company-non-prefix-completion ()
-  (with-temp-buffer
-    (insert "tc")
-    (company-mode)
-    (let (company-frontends
-          company-end-of-buffer-workaround
-          (company-backends
-           (list (lambda (command &optional arg)
-                   (case command
-                     (prefix (buffer-substring (point-min) (point)))
-                     (candidates '("tea-cup" "teal-color")))))))
-      (let (this-command)
-        (company-complete))
       (should (string= "tc" (buffer-string)))
       (company-complete-selection)
       (should (string= "tea-cup" (buffer-string))))))
diff --git a/company.el b/company.el
index 1015415..1a324c7 100644
--- a/company.el
+++ b/company.el
@@ -828,13 +828,13 @@ can retrieve meta-data for them."
   ;; Save in cache:
   (push (cons company-prefix company-candidates) company-candidates-cache)
   ;; Calculate common.
-  (let ((completion-ignore-case (company-call-backend 'ignore-case))
-        ;; We want to support non-prefix completion, so filtering is the
-        ;; responsibility of each respective backend, not ours.
-        ;; On the other hand, we don't want to replace non-prefix input in
-        ;; `company-complete-common'.
-        (common (try-completion company-prefix company-candidates)))
-    (setq company-common (company--safe-candidate common))))
+  (let ((completion-ignore-case (company-call-backend 'ignore-case)))
+    ;; We want to support non-prefix completion, so filtering is the
+    ;; responsibility of each respective backend, not ours.
+    ;; On the other hand, we don't want to replace non-prefix input in
+    ;; `company-complete-common'.
+    (setq company-common (company--safe-candidate
+                          (try-completion company-prefix 
company-candidates)))))
 
 (defun company--safe-candidate (str)
   (or (company-call-backend 'crop str)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.



reply via email to

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