branch: master commit 66a9e6540ce20bf75d397924d7760a385b5d9e2f Author: Nikita Leshenko <nik...@leshenko.net> Commit: Nikita Leshenko <nik...@leshenko.net>
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