yasnippet/extras/imported/ruby-mode/Declarations/Wrap in Begin … Rescue … End.yasnippet
capitaomorte 57c150b42d * Finished commiting Rob Christie's patches to the ruby snippets (add
setup.el, delete the # => snippet)

* Tweaked some ruby snippets

* Disabled bindings for some TextMate text-mode snippets
2009-10-15 14:08:17 +00:00

18 lines
437 B
Plaintext

# -*- mode: snippet -*-
# key: begin
# contributor: Translated from TextMate Snippet
# name: begin … rescue … end
## binding: "C-c C-w"
# condition: (not (yas/ruby-in-comment-p))
# --
begin
`(or yas/selected-text
(and cua-mode
(prog1
(get-register ?0)
(set-register ?0 nil)))
(car kill-ring))`$3
rescue ${1:Exception}${2:$(if (string= yas/text "") "" " => ")}${2:e}
$0
end