branch: externals/company
commit 484c99be29a5f71afba202fe0f8cbceea4509965
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
company-dot-icons-margin: Return nil when backend indicates no kind
---
company.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/company.el b/company.el
index 235f36a..1acb46f 100644
--- a/company.el
+++ b/company.el
@@ -1539,10 +1539,11 @@ end of the match."
(defun company-dot-icons-margin (candidate _selected)
"Margin function that uses a colored dot to display completion kind."
- (propertize company-dot-icons-format 'face
- (or (assoc-default (company-call-backend 'kind candidate)
- company-dot-icons-face-mapping)
- (assoc-default t company-dot-icons-face-mapping))))
+ (when-let ((kind (company-call-backend 'kind candidate))
+ (face (or (assoc-default kind
+ company-dot-icons-face-mapping)
+ (assoc-default t company-dot-icons-face-mapping))))
+ (propertize company-dot-icons-format 'face face)))
(defun company-detect-icons-margin (candidate selected)
"Margin function which picks from vscodes icons or unicode icons