mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
* yas/next-field' rewritten, now
yas/expand' fails...
This commit is contained in:
parent
953ffbf299
commit
0622075ba9
13
yasnippet.el
13
yasnippet.el
@ -988,13 +988,11 @@ inserted first."
|
|||||||
1))
|
1))
|
||||||
(snippet (first (yas/snippets-at-point)))
|
(snippet (first (yas/snippets-at-point)))
|
||||||
(active-field (overlay-get yas/active-field-overlay 'yas/field))
|
(active-field (overlay-get yas/active-field-overlay 'yas/field))
|
||||||
(number (and snippet
|
|
||||||
(yas/field-number active-field)
|
|
||||||
(+ arg
|
|
||||||
(yas/field-number active-field))))
|
|
||||||
(live-fields (remove-if #'yas/field-probably-deleted-p (yas/snippet-fields snippet)))
|
(live-fields (remove-if #'yas/field-probably-deleted-p (yas/snippet-fields snippet)))
|
||||||
(target-field (yas/snippet-find-field snippet number)))
|
(active-field-pos (position active-field live-fields))
|
||||||
;; First check if we're moving out of a field
|
(target-pos (+ arg active-field-pos))
|
||||||
|
(target-field (nth target-pos live-fields)))
|
||||||
|
;; First check if we're moving out of a field with a transform
|
||||||
;;
|
;;
|
||||||
(when (and active-field
|
(when (and active-field
|
||||||
(yas/field-transform active-field))
|
(yas/field-transform active-field))
|
||||||
@ -1004,8 +1002,7 @@ inserted first."
|
|||||||
(yas/modified-p (yas/field-modified-p active-field)))
|
(yas/modified-p (yas/field-modified-p active-field)))
|
||||||
(yas/eval-string (yas/field-transform active-field))))
|
(yas/eval-string (yas/field-transform active-field))))
|
||||||
;; Now actually move...
|
;; Now actually move...
|
||||||
(cond ((and number
|
(cond ((>= target-pos (length live-fields))
|
||||||
(> number (length live-fields)))
|
|
||||||
(yas/exit-snippet snippet))
|
(yas/exit-snippet snippet))
|
||||||
(target-field
|
(target-field
|
||||||
(yas/move-to-field snippet target-field))
|
(yas/move-to-field snippet target-field))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user