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

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

[ELPA-diffs] [elpa] 03/05: If there's just one candidate, set company-co


From: Dmitry Gutov
Subject: [ELPA-diffs] [elpa] 03/05: If there's just one candidate, set company-common to it
Date: Wed, 15 Jan 2014 05:34:19 +0000

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

dgutov pushed a commit to branch master
in repository elpa.

commit da7ac3d9b11f02adc538244821dd8db66d0eba8e
Author: Dmitry Gutov <address@hidden>
Date:   Wed Jan 15 05:06:21 2014 +0200

    If there's just one candidate, set company-common to it
---
 company.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index 5d1355e..ae2ec51 100644
--- a/company.el
+++ b/company.el
@@ -833,8 +833,11 @@ can retrieve meta-data for them."
     ;; 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)))))
+    (setq company-common
+          (if (cdr company-candidates)
+              (company--safe-candidate
+               (try-completion company-prefix company-candidates))
+            (car 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]