]> code.delx.au - gnu-emacs-elpa/commitdiff
company-clang: don't mistake scoping operator for objc args
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 28 Apr 2014 10:05:35 +0000 (14:05 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 28 Apr 2014 23:11:52 +0000 (03:11 +0400)
company-clang.el

index 4f0f3189eb45e4db3c6e9d86f50817b79bb1dee8..1ddb7caa1a82a032cae914d589ad96787e8cbf51 100644 (file)
@@ -145,7 +145,7 @@ or automatically through a custom `company-clang-prefix-guesser'."
   (let ((meta (company-clang--meta candidate)))
     (cond
      ((null meta) nil)
-     ((string-match ":" meta)
+     ((string-match "[^:]:[^:]" meta)
       (substring meta (match-beginning 0)))
      ((string-match "\\((.*)\\'\\)" meta)
       (match-string 1 meta)))))
@@ -316,9 +316,9 @@ passed via standard input."
     (post-completion (let ((anno (company-clang--annotation arg)))
                        (when (and company-clang-insert-arguments anno)
                          (insert anno)
-                         (if (string-match ":" anno)
+                         (if (string-match "[^:]:[^:]" anno)
                              (company-clang-objc-templatify anno)
-                          (company-template-c-like-templatify anno)))))))
+                           (company-template-c-like-templatify anno)))))))
 
 (provide 'company-clang)
 ;;; company-clang.el ends here