branch: master commit ed97b73ca38feaf4f8ae212442d1913e1dbb9425 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
company--insert-candidate: Don't change buffer modification status unnecessarily Fixes #256 --- company.el | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/company.el b/company.el index 9f22027..efe3c32 100644 --- a/company.el +++ b/company.el @@ -978,8 +978,9 @@ Controlled by `company-auto-complete'.") ;; XXX: Return value we check here is subject to change. (if (eq (company-call-backend 'ignore-case) 'keep-prefix) (insert (company-strip-prefix candidate)) - (delete-region (- (point) (length company-prefix)) (point)) - (insert candidate))) + (unless (equal company-prefix candidate) + (delete-region (- (point) (length company-prefix)) (point)) + (insert candidate)))) (defmacro company-with-candidate-inserted (candidate &rest body) "Evaluate BODY with CANDIDATE temporarily inserted.