Last active
December 15, 2015 00:28
-
-
Save chrisroberts/5173018 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(setq ruby-deep-indent-paren nil) | |
(defadvice ruby-indent-line (after unindent-closing-paren activate) | |
(let ((column (current-column)) | |
indent offset) | |
(save-excursion | |
(back-to-indentation) | |
(let ((state (syntax-ppss))) | |
(setq offset (- column (current-column))) | |
(when (and (eq (char-after) ?\)) | |
(not (zerop (car state)))) | |
(goto-char (cadr state)) | |
(setq indent (current-indentation))))) | |
(when indent | |
(indent-line-to indent) | |
(when (> offset 0) (forward-char offset))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment