yasnippet/extras/imported/ruby-mode/Blocks/open yield block ({).yasnippet
2009-11-27 16:05:05 +00:00

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)
"" "}"))))