mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
(yas--all-parents): delete-dups for fundamental-mode
Before this commit, (yas--all-parents 'lisp-mode) would return: `(lisp-mode lisp-data-mode prog-mode fundamental-mode fundamental-mode)` which would cause duplicated entries when prompting, if the snippet were for fundamental-mode.
This commit is contained in:
parent
33587a8551
commit
e23a80177a
@ -848,6 +848,7 @@ which decides on the snippet to expand.")
|
|||||||
(cons (if (eq mode 'fundamental-mode) ()
|
(cons (if (eq mode 'fundamental-mode) ()
|
||||||
(append (cdr ap) '(fundamental-mode)))
|
(append (cdr ap) '(fundamental-mode)))
|
||||||
extras))))
|
extras))))
|
||||||
|
(delete-dups
|
||||||
(cons mode
|
(cons mode
|
||||||
(yas--merge-ordered-lists
|
(yas--merge-ordered-lists
|
||||||
(mapcar #'yas--all-parents
|
(mapcar #'yas--all-parents
|
||||||
@ -859,7 +860,7 @@ which decides on the snippet to expand.")
|
|||||||
,(let ((alias (symbol-function mode)))
|
,(let ((alias (symbol-function mode)))
|
||||||
(when (symbolp alias) alias))
|
(when (symbolp alias) alias))
|
||||||
,@(get mode 'derived-mode-extra-parents)
|
,@(get mode 'derived-mode-extra-parents)
|
||||||
,@(gethash mode yas--parents)))))))))
|
,@(gethash mode yas--parents))))))))))
|
||||||
(dolist (parent all-parents)
|
(dolist (parent all-parents)
|
||||||
(cl-pushnew mode (get parent 'yas--cached-children)))
|
(cl-pushnew mode (get parent 'yas--cached-children)))
|
||||||
(put mode 'yas--all-parents all-parents)))))
|
(put mode 'yas--all-parents all-parents)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user