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

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

[elpa] master 8952cfe 085/173: Handle key prefix being shorter than pref


From: Dmitry Gutov
Subject: [elpa] master 8952cfe 085/173: Handle key prefix being shorter than prefix (#422)
Date: Thu, 23 Jun 2016 00:28:40 +0000 (UTC)

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

    Handle key prefix being shorter than prefix (#422)
---
 company-yasnippet.el |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/company-yasnippet.el b/company-yasnippet.el
index 72d1fc2..93e6eb2 100644
--- a/company-yasnippet.el
+++ b/company-yasnippet.el
@@ -87,8 +87,12 @@
                   (propertize key
                               'yas-annotation name
                               'yas-template template
-                              'yas-prefix-offset (- (length key-prefix)
-                                                    (length prefix)))
+                              'yas-prefix-offset
+                              (let ((pl (length prefix))
+                                    (kpl (length key-prefix)))
+                                (if (> kpl pl)
+                                    (- kpl pl)
+                                  0)))
                   res))
                value)))
           keyhash))



reply via email to

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