;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require ivy yasnippet dash cl-lib] 2) (defvar ivy-yasnippet--buffer nil) (defvar ivy-yasnippet--template-alist nil) (defvar ivy-yasnippet--region nil) (defvar ivy-yasnippet--region-contents nil) (defvar ivy-yasnippet--key nil) (defvar ivy-yasnippet--key-deleted nil) (defvar ivy-yasnippet--should-delete-key nil) (byte-code "\300\301\302\303\304\305\304\306&\210\307\310\311\312\304\301\313\314&\210\307\315\316\317\304\301\313\320&\210\307\321\322\323\304\301\313\324&\210\325\326\327\330\304\301%\210\325\331\332\333\304\301%\207" [custom-declare-group ivy-yasnippet nil "Preview yasnippets with ivy." :group ivy yasnippet custom-declare-variable ivy-yasnippet-expand-keys 'smart "Value that says how to expand keys before point.\nIf it's nil, never expand keys.\nIf it's the symbol `always`, always try to expand keys.\nIf it's the symbol `smart`, expand when a matching candidate is selected for\nthe first time. Once a candidate whose key doesn't match whatever is before\npoint is selected, behave like nil until the minibuffer exits." :type (choice (const :tag "Never" nil) (const :tag "Always" always) (const :tag "Expand until a nonexpandable candidate is selected" smart)) ivy-yasnippet-create-snippet-if-not-matched t "If non-nil, allow exiting the minibuffer without exact match.\nDoing so will pop up a new buffer for writing a snippet." boolean ivy-yasnippet-new-snippet "# name: ${1:`name`}${2:\n# key: ${3:key}}${4:\n# keybinding: ${5:keybinding}}${6:\n# expand-env: (${7:(var val)})}${8:\n# contributor: $9}\n# --\n$0`yas-selected-text`" "Snippet to expand when creating new snippet.\nDuring expansion, `name` is bound to whatever was returned by `ivy-read'." string custom-declare-face ivy-yasnippet-key ((t :inherit font-lock-type-face)) "Face used for keys." ivy-yasnippet-key-matching ((t :inherit ivy-yasnippet-key :weight bold)) "Face used for keys that match whatever is before point."] 8) (defalias 'ivy-yasnippet--lookup-template #[(name) "\302 \"A\207" [name ivy-yasnippet--template-alist assoc] 3]) (defalias 'ivy-yasnippet--revert #[nil "@A|\210@b\210 \203\nc\210\304`\240\210 c\210`\241\207" [ivy-yasnippet--region ivy-yasnippet--key-deleted ivy-yasnippet--key ivy-yasnippet--region-contents nil] 2]) (defalias 'ivy-yasnippet--expand-template #[(template) "\306 \210@b\210 \307\230\204\310`!\210\310A\311\312#\210\202l\n\203g \204g\f\203g\f\313 !>\2048\314\315\316 D\"\210 \317H\230\203g\fG\320[!\210\211\211@Z\240\210)\211\211AZ\241\210)\312)\202l\321=\322\313 !>\204}\314\315\316 D\"\210 \323H\311\211\313 !>\204\222\314\315\316 D\"\210 \324H$\207" [ivy-yasnippet--region ivy-yasnippet--region-contents ivy-yasnippet--should-delete-key ivy-yasnippet--key-deleted ivy-yasnippet--key template deactivate-mark "" push-mark nil t type-of signal wrong-type-argument yas--template 1 delete-char always yas-expand-snippet 2 5 cl-struct-yas--template-tags length #1=#:v #2=#:v ivy-yasnippet-expand-keys] 9]) (defalias 'ivy-yasnippet--preview #[(template) "rq\210\306\307\211d AZ\310 \311 \210\312\216\313!\210.\314 )\207" [ivy-yasnippet--buffer ivy-yasnippet--region yas-prompt-functions orig-offset inhibit-read-only inhibit-redisplay 0 t (yas-no-prompt) ivy-yasnippet--revert #[nil "\300\216\301\302\303ed\"\")\207" [#[nil "d Z\241\207" [ivy-yasnippet--region orig-offset] 3] mapc yas--commit-snippet yas-active-snippets] 5] ivy-yasnippet--expand-template redisplay yas-verbosity template] 5]) (defalias 'ivy-yasnippet--update-fn #[nil "\304H\305 !\211\205\3061\307\n!0\202\310\311 \")*\207" [ivy-last candidate template err 23 ivy-yasnippet--lookup-template (debug error) ivy-yasnippet--preview warn "ivy-yasnippet--update-fn: %S"] 4]) (defalias 'ivy-yasnippet--visit-snippet-action #[(template-name) "\302\303 \210)\304\305 !!\207" [inhibit-read-only template-name t ivy-yasnippet--revert yas--visit-snippet-file-1 ivy-yasnippet--lookup-template] 3]) #@384 Read a snippet name from the minibuffer and expand it at point. The completion is done using `ivy-read'. In the minibuffer, each time selection changes, the selected snippet is temporarily expanded at point for preview. If text before point matches snippet key of any candidate, that candidate will be initially selected, unless variable `ivy-yasnippet-expand-keys' is set to nil. (defalias 'ivy-yasnippet #[nil "\306 \210\204 \307\310!\210p\311 \203\312 \313 B\202``B\211@\nA{\314 \211\2053\fA@\fAA@{\315\316\f@\"3\31745\320>6\315\321\322\323 !\"7\324 8\317\2119:\325;\326\327\330\326\331\332\333\"\334\3357\"\"!\"9\336\216\325<\337\3409\341=?\342\343\344\345\346 \205\207\347\3509\"\351\352&\f\210+:\205\300\353:!\211>\203\243\354>!\202\277?>\355\325!\210\356\357!\205\277\360>\317\211\361:D\362 DD$).\f\207" [yas-minor-mode ivy-yasnippet--buffer ivy-yasnippet--region ivy-yasnippet--region-contents key-info ivy-yasnippet--key barf-if-buffer-read-only error "`yas-minor-mode' not enabled in current buffer" region-active-p region-beginning region-end yas--templates-for-key-at-point mapcar cdr nil (always smart) #[(template) "\302! >\204\303\304\305D\"\210\306HB\207" [template cl-struct-yas--template-tags type-of signal wrong-type-argument yas--template 3] 4] yas--all-templates yas--get-snippet-tables buffer-modified-p t -map car -flatten -partial -sort #[(a b) "@ @\231\207" [a b] 2] -separate #[(#1=#:input0) "A\211\n>)\207" [#1# template templates-for-key-at-point] 3] #[nil "\301 \210\302!\207" [modified-flag ivy-yasnippet--revert set-buffer-modified-p] 2] ivy-read "Choose a snippet: " :require-match :update-fn ivy-yasnippet--update-fn :action #[(candidate) "\211\207" [candidate selection] 2] :preselect -find-index #[(x) "\304 !\305\n! >\204\306\307\310\nD\"\210\n\311H)\230\207" [ivy-yasnippet--key x cl-x cl-struct-yas--template-tags ivy-yasnippet--lookup-template type-of signal wrong-type-argument yas--template 1] 5] :caller ivy-yasnippet ivy-yasnippet--lookup-template ivy-yasnippet--expand-template yas-new-snippet derived-mode-p snippet-mode yas-expand-snippet name yas-selected-text templates-for-key-at-point ivy-yasnippet--key-deleted ivy-yasnippet-expand-keys ivy-yasnippet--should-delete-key ivy-yasnippet--template-alist modified-flag candidates selection buffer-undo-list buffer-read-only ivy-yasnippet-create-snippet-if-not-matched template ivy-yasnippet-new-snippet] 14 (#$ . 4106) nil]) (defalias 'ivy-yasnippet-transformer #[(template-name) "\306!\307 !\n>\204\310\311\312 D\"\210 \313H\211\2037\314\315\316 \317Q\320 \f\230\2031 \2031\321\2022\322#Q\2028*\207" [template-name template cl-struct-yas--template-tags key ivy-yasnippet--key ivy-yasnippet--should-delete-key ivy-yasnippet--lookup-template type-of signal wrong-type-argument yas--template 1 " " propertize "[" "]" face ivy-yasnippet-key-matching ivy-yasnippet-key] 8]) (byte-code "\300\301\302\"\210\303\301\304\"\210\305\301!\207" [ivy-set-display-transformer ivy-yasnippet ivy-yasnippet-transformer ivy-add-actions (("v" ivy-yasnippet--visit-snippet-action "Visit snippet file")) provide] 3)