branch: master commit a87ec549a6a69ff7ef02d183585b202e6bb3dc43 Author: Noam Postavsky <npost...@users.sourceforge.net> Commit: Noam Postavsky <npost...@users.sourceforge.net>
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