]> code.delx.au - gnu-emacs-elpa/blobdiff - company-clang.el
Support template functions in company-clang annotations
[gnu-emacs-elpa] / company-clang.el
index f30bf1493dddb48ecec10c97538f5f40c8cd4c66..459056d0b3eb7658e671cab4fc8fe542d7d22d4a 100644 (file)
@@ -150,7 +150,13 @@ or automatically through a custom `company-clang-prefix-guesser'."
      ((string-match "[^:]:[^:]" meta)
       (substring meta (1+ (match-beginning 0))))
      ((string-match "\\((.*)[ a-z]*\\'\\)" meta)
-      (match-string 1 meta)))))
+      (let ((paren (match-beginning 1)))
+        (if (not (eq (aref meta (1- paren)) ?>))
+            (match-string 1 meta)
+          (with-temp-buffer
+            (insert meta)
+            (goto-char paren)
+            (substring meta (1- (search-backward "<"))))))))))
 
 (defun company-clang--strip-formatting (text)
   (replace-regexp-in-string