(let* ((end (point-marker))
(beg (- (point) (length call)))
(cnt 0))
+ (when (re-search-backward ")" beg t)
+ (delete-region (match-end 0) end))
(goto-char beg)
(when (search-forward "(" end 'move)
(if (eq (char-after) ?\))
(should (equal "int a"
(overlay-get (company-template-field-at) 'display))))))
+(ert-deftest company-template-c-like-templatify-trims-after-closing-paren ()
+ (with-temp-buffer
+ (let ((text "foo(int a, short b)!@ #1334 a"))
+ (insert text)
+ (company-template-c-like-templatify text)
+ (should (equal "foo(arg0, arg1)" (buffer-string)))
+ (should (looking-at "arg0")))))
+
;;; Elisp
(defmacro company-elisp-with-buffer (contents &rest body)