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

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

[elpa] master 1ec2351 10/13: Fix default score calc function for missing


From: Dmitry Gutov
Subject: [elpa] master 1ec2351 10/13: Fix default score calc function for missing global score
Date: Wed, 28 Jan 2015 13:09:10 +0000

branch: master
commit 1ec23517326b504064756eec6ef47d3510c7861c
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>

    Fix default score calc function for missing global score
---
 company-statistics.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/company-statistics.el b/company-statistics.el
index 2d913b7..de9d51a 100644
--- a/company-statistics.el
+++ b/company-statistics.el
@@ -154,7 +154,8 @@ number)."
   "Global score, and bonus for matching major mode and filename."
   (let ((scores (gethash cand company-statistics--scores)))
     (if scores
-        (+ (cdr (assoc nil scores))
+        ;; cand may be in scores and still have no global score left
+        (+ (or (cdr (assoc nil scores)) 0)
            (or (cdr (assoc major-mode scores)) 0)
            (or (cdr (when buffer-file-name ;to not get nil context
                       (assoc buffer-file-name scores))) 0))



reply via email to

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