From a87ec549a6a69ff7ef02d183585b202e6bb3dc43 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 26 Jan 2016 15:41:46 -0500 Subject: [PATCH] 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