branch: master commit 1ec23517326b504064756eec6ef47d3510c7861c Author: Ingo Lohmar <i.loh...@gmail.com> Commit: Ingo Lohmar <i.loh...@gmail.com>
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))