mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
14 lines
578 B
Plaintext
14 lines
578 B
Plaintext
# -*- mode: snippet -*-
|
|
# type: command
|
|
# key: {
|
|
# contributor: Translated from TextMate Snippet
|
|
# name: Insert { |variable| … }
|
|
# condition: (not (or (yas/ruby-in-comment-p) (yas/ruby-in-string-p)))
|
|
# --
|
|
(yas/expand-snippet (concat
|
|
"{ ${1:$(if (string= yas/text \"\") \"\" \"|\")}${1:variable}${1:$(if (string= yas/text \"\") \" \" \"| \")}`yas/selected-text`$0"
|
|
(save-excursion (if (search-forward-regexp "}" (line-end-position) t)
|
|
"" "}"))))
|
|
|
|
|