Created
December 3, 2010 00:34
-
-
Save aaroncampos/726376 to your computer and use it in GitHub Desktop.
YAsnippet / ruby-electric-mode workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Yasnippet workaround for ruby-electric-mode | |
;; See: http://code.google.com/p/yasnippet/issues/detail?id=71 | |
(defun yas/advise-indent-function (function-symbol) | |
(eval `(defadvice ,function-symbol (around yas/try-expand-first activate) | |
,(format | |
"Try to expand a snippet before point, then call `%s' as usual" | |
function-symbol) | |
(let ((yas/fallback-behavior nil)) | |
(unless (and (interactive-p) | |
(yas/expand)) | |
ad-do-it))))) | |
(yas/advise-indent-function 'ruby-indent-line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks mate, i had been looking around a lot for this!