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

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

[elpa] master d982b70 135/177: Fix edge case in yas-longest-key-from-whi


From: João Távora
Subject: [elpa] master d982b70 135/177: Fix edge case in yas-longest-key-from-whitespace
Date: Sat, 28 Mar 2015 15:41:27 +0000

branch: master
commit d982b701fc4dc2e37e1a02b0aed2f0f713d9bf68
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix edge case in yas-longest-key-from-whitespace
    
    * yasnippet.el (yas-longest-key-from-whitespace): don't try again if
      start-point is on whitespace.
    * yasnippet-tests.el (complicated-yas-key-syntaxes): check edge case.
---
 yasnippet-tests.el |    3 ++-
 yasnippet.el       |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index d090c51..4b3a440 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -351,7 +351,8 @@ TODO: correct this bug!"
              (yas--foobarbaz t) (yas--barbaz t))
          (yas-should-expand '(("foo-barbaz" . "foo-barOKbazOK")))
          (setq yas-key-syntaxes '(yas-longest-key-from-whitespace))
-         (yas-should-expand '(("foo-barbaz" . "OKfoo-barbazOK"))))))))
+         (yas-should-expand '(("foo-barbaz" . "OKfoo-barbazOK")
+                              ("foo " . "foo "))))))))
 
 
 ;;; Loading
diff --git a/yasnippet.el b/yasnippet.el
index 900d326..ea5fe33 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -2749,7 +2749,7 @@ marks it as something else (typically comment ender)."
   (if (= (point) start-point)
       (yas-try-key-from-whitespace start-point)
     (forward-char))
-  (unless (= original (1+ (point)))
+  (unless (<= start-point (1+ (point)))
     'again))
 
 



reply via email to

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