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

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

[elpa] master 66a9e65 15/78: company-tng: Use 'after-string when the pre


From: Dmitry Gutov
Subject: [elpa] master 66a9e65 15/78: company-tng: Use 'after-string when the prefix is empty
Date: Sun, 18 Feb 2018 07:40:13 -0500 (EST)

branch: master
commit 66a9e6540ce20bf75d397924d7760a385b5d9e2f
Author: Nikita Leshenko <address@hidden>
Commit: Nikita Leshenko <address@hidden>

    company-tng: Use 'after-string when the prefix is empty
    
    The 'display property only works when an overlay's length is not zero. 
There can
    be cases where `company-prefix' will be empty (for example, when the 
completion
    was triggered manually). In that case, use the 'after-string property 
instead.
---
 company-tng.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/company-tng.el b/company-tng.el
index c603d50..3996f31 100644
--- a/company-tng.el
+++ b/company-tng.el
@@ -83,6 +83,9 @@ confirm the selection and finish the completion."
            (selected (nth company-selection company-candidates))
            (prefix (length company-prefix)))
        (move-overlay ov (- (point) prefix) (point))
+       (overlay-put ov
+                    (if (= prefix 0) 'after-string 'display)
+                    (and company-selection-changed selected))
        (overlay-put ov 'display (and company-selection-changed selected))))
     (hide
      (when company-tng--overlay



reply via email to

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