]> code.delx.au - gnu-emacs-elpa/blobdiff - company-yasnippet.el
Merge pull request #106 from proofit404/master
[gnu-emacs-elpa] / company-yasnippet.el
index ae370c78feca440e0eb64cc024604e3fd88fb111..741a160086707a5ed25c4681a63f0c7bd4488c02 100644 (file)
@@ -25,6 +25,7 @@
 
 ;;; Code:
 
+(require 'cl-lib)
 (require 'yasnippet)
 
 (defun company-yasnippet--candidates (prefix)
@@ -74,14 +75,17 @@ shadow back-ends that come after it.  Recommended usages:
   (global-set-key (kbd \"C-c y\") 'company-yasnippet)
 "
   (interactive (list 'interactive))
-  (case command
+  (cl-case command
     (interactive (company-begin-backend 'company-yasnippet))
     (prefix
      ;; Should probably use `yas--current-key', but that's bound to be slower.
      ;; How many trigger keys start with non-symbol characters anyway?
      (and yas-minor-mode
           (company-grab-symbol)))
-    (annotation (concat " -> " (get-text-property 0 'yas-annotation arg)))
+    (annotation
+     (concat
+      (unless company-tooltip-align-annotations " -> ")
+      (get-text-property 0 'yas-annotation arg)))
     (candidates (company-yasnippet--candidates arg))
     (post-completion
      (let ((template (get-text-property 0 'yas-template arg)))