From 012887ae4ab7f7fe6fd582e45c8f28ed605e1218 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 14 Apr 2014 05:09:43 +0400 Subject: [PATCH] Introduce company-clang-insert-arguments Closes #102 --- NEWS.md | 1 + company-clang.el | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 591c9e73e..9037b0103 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ## Next +* New user option `company-clang-insert-arguments`, by default t. * Default value of `company-idle-delay` lowered to `0.5`. * New user option `company-tooltip-minimum-width`, by default 0. * New function `company-grab-symbol-cons`. diff --git a/company-clang.el b/company-clang.el index 14b6753e6..4f0f3189e 100644 --- a/company-clang.el +++ b/company-clang.el @@ -60,6 +60,9 @@ or automatically through a custom `company-clang-prefix-guesser'." (defvar company-clang-modes '(c-mode c++-mode objc-mode) "Major modes which clang may complete.") +(defcustom company-clang-insert-arguments t + "When non-nil, insert function arguments as a template after completion.") + ;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar company-clang--prefix nil) @@ -311,7 +314,7 @@ passed via standard input." (meta (company-clang--meta arg)) (annotation (company-clang--annotation arg)) (post-completion (let ((anno (company-clang--annotation arg))) - (when anno + (when (and company-clang-insert-arguments anno) (insert anno) (if (string-match ":" anno) (company-clang-objc-templatify anno) -- 2.39.2