Skip to content

Instantly share code, notes, and snippets.

@paulv
Created February 10, 2012 00:38
Show Gist options
  • Save paulv/1784825 to your computer and use it in GitHub Desktop.
Save paulv/1784825 to your computer and use it in GitHub Desktop.
ruby-mode 1.1 indents the following code like this
if true
val = string.split(/=/)
puts val
end
The puts line should be indented so that it matches the val line.
If you look at line 522 of ruby-mode.el (version 1.1, from elpa, I suspect other versions have the same code at possibly different line numbers) it says
((looking-at "/=")
(goto-char pnt))
if you change that to
((and (looking-at "/=") (not (looking-at "/=/"))
(goto-char pnt)))
the above example is indented correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment