branch: master commit d8b69764e1a4a4e3c7ad846ed906589cb263e729 Merge: 99dbae9 1af6121 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: GitHub <nore...@github.com>
Merge pull request #610 from juergenhoetzel/fix-invalid-use-of-string-match Fix invalid use of string match --- company.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/company.el b/company.el index d9b3fac..38bf7b8 100644 --- a/company.el +++ b/company.el @@ -1448,7 +1448,7 @@ prefix match (same case) will be prioritized." (eq company-require-match t)))))) (defun company-auto-complete-p (input) - "Return non-nil, if input starts with punctuation or parentheses." + "Return non-nil, if INPUT starts with punctuation or parentheses." (and (if (functionp company-auto-complete) (funcall company-auto-complete) company-auto-complete) @@ -1457,7 +1457,8 @@ prefix match (same case) will be prioritized." (if (consp company-auto-complete-chars) (memq (char-syntax (string-to-char input)) company-auto-complete-chars) - (string-match (substring input 0 1) company-auto-complete-chars))))) + (string-match (regexp-quote (substring input 0 1)) + company-auto-complete-chars))))) (defun company--incremental-p () (and (> (point) company-point)