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

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

[elpa] master a87ec54 12/36: yasnippet.el (yas-next-field-will-exit-p):


From: Noam Postavsky
Subject: [elpa] master a87ec54 12/36: yasnippet.el (yas-next-field-will-exit-p): New function.
Date: Sat, 11 Jun 2016 19:21:10 +0000 (UTC)

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

    yasnippet.el (yas-next-field-will-exit-p): New function.
---
 yasnippet.el |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/yasnippet.el b/yasnippet.el
index a4e9b37..4c1efcd 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3063,6 +3063,13 @@ Otherwise delegate to `yas-next-field'."
             (yas-next-field))))
     (yas-next-field)))
 
+(defun yas-next-field-will-exit-p (&optional arg)
+  "Return non-nil if (yas-next-field ARG) would exit the current snippet."
+  (let ((snippet (car (yas--snippets-at-point)))
+        (active (overlay-get yas--active-field-overlay 'yas--field)))
+    (when snippet
+      (not (yas--find-next-field arg snippet active)))))
+
 (defun yas--find-next-field (n snippet active)
   "Return the Nth field after the ACTIVE one in SNIPPET."
   (let ((live-fields (cl-remove-if



reply via email to

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