Support expanding a snippet inside another snippet (only if not inside a field)

This commit is contained in:
Zhang Chiyuan 2008-03-14 01:27:22 +00:00
parent dbada984cf
commit e98815c030

View File

@ -797,7 +797,8 @@ Run `indent-for-tab-command'."
(interactive)
(let ((command (key-binding (kbd "TAB"))))
(if (and command
(not (eq command 'yas/expand)))
(not (eq command 'yas/expand))
(not (eq command 'yas/next-field-group)))
(call-interactively command)
(call-interactively 'indent-for-tab-command))))
@ -927,14 +928,14 @@ the menu if `yas/use-menu' is `t'."
(tabstop (car tabstops) (car tabstops)))
((or (null tabstops)
done)
(unless done (message "Not in a snippet field.")))
(unless done (call-interactively 'yas/expand)))
(when (= (point)
(overlay-start
(yas/field-overlay
(yas/group-primary-field tabstop))))
(setq done t)
(yas/navigate-group tabstop t)))
(message "Not in a snippet field."))))))
(call-interactively 'yas/expand))))))
(defun yas/prev-field-group ()
"Navigate to prev field group. If there's none, exit the snippet."