]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix edge case in yas-longest-key-from-whitespace
authorNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 10 Aug 2014 17:29:25 +0000 (13:29 -0400)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 10 Aug 2014 18:05:26 +0000 (14:05 -0400)
* 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
yasnippet.el

index d090c511dd884253385c74d30cb21647be5a545c..4b3a4400bce7dbe9fd5b113688c266552c2b827d 100644 (file)
@@ -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 "))))))))
 
 \f
 ;;; Loading
index 900d3267f489dc33862b659aa96f3c858810014c..ea5fe33c6e888b017f5fc95f4e7552bd663b8053 100644 (file)
@@ -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))