emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master ed97b73 34/66: company--insert-candidate: Don't change buf


From: Dmitry Gutov
Subject: [elpa] master ed97b73 34/66: company--insert-candidate: Don't change buffer modification status unnecessarily
Date: Tue, 13 Jan 2015 02:44:55 +0000

branch: master
commit ed97b73ca38feaf4f8ae212442d1913e1dbb9425
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]