yasnippet.el (yas-next-field-will-exit-p): New function.

This commit is contained in:
Noam Postavsky 2016-01-26 15:41:46 -05:00
parent cc14db399c
commit a87ec549a6

View File

@ -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