Skip to content

Instantly share code, notes, and snippets.

@teaforthecat
Forked from fujin/ruby.el
Created March 21, 2013 01:33

Revisions

  1. AJ Christensen renamed this gist Mar 15, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @chrisroberts chrisroberts created this gist Mar 15, 2013.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    (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)))))