mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
Support expanding a snippet inside another snippet (only if not inside a field)
This commit is contained in:
parent
dbada984cf
commit
e98815c030
@ -797,7 +797,8 @@ Run `indent-for-tab-command'."
|
|||||||
(interactive)
|
(interactive)
|
||||||
(let ((command (key-binding (kbd "TAB"))))
|
(let ((command (key-binding (kbd "TAB"))))
|
||||||
(if (and command
|
(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 command)
|
||||||
(call-interactively 'indent-for-tab-command))))
|
(call-interactively 'indent-for-tab-command))))
|
||||||
|
|
||||||
@ -927,14 +928,14 @@ the menu if `yas/use-menu' is `t'."
|
|||||||
(tabstop (car tabstops) (car tabstops)))
|
(tabstop (car tabstops) (car tabstops)))
|
||||||
((or (null tabstops)
|
((or (null tabstops)
|
||||||
done)
|
done)
|
||||||
(unless done (message "Not in a snippet field.")))
|
(unless done (call-interactively 'yas/expand)))
|
||||||
(when (= (point)
|
(when (= (point)
|
||||||
(overlay-start
|
(overlay-start
|
||||||
(yas/field-overlay
|
(yas/field-overlay
|
||||||
(yas/group-primary-field tabstop))))
|
(yas/group-primary-field tabstop))))
|
||||||
(setq done t)
|
(setq done t)
|
||||||
(yas/navigate-group tabstop t)))
|
(yas/navigate-group tabstop t)))
|
||||||
(message "Not in a snippet field."))))))
|
(call-interactively 'yas/expand))))))
|
||||||
|
|
||||||
(defun yas/prev-field-group ()
|
(defun yas/prev-field-group ()
|
||||||
"Navigate to prev field group. If there's none, exit the snippet."
|
"Navigate to prev field group. If there's none, exit the snippet."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user