From 1fc8f6559a8ef1df2f55a12d6dd70ee62f34f1f6 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 21 Mar 2014 06:26:39 +0200 Subject: [PATCH] Fix bug#17050 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Add indentation rule for ` @ '. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/ruby-mode.el | 4 ++++ test/indent/ruby.rb | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a9acd99423..d77e4e4b4be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-21 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie-rules): + Add indentation rule for ` @ '. (Bug#17050) + 2014-03-21 Juanma Barranquero * align.el (align-regexp): Remove superfluous backslash. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index fe9346047c6..e05aef80e86 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -650,6 +650,10 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." ;; because we want to reject hanging tokens at bol, too. (unless (or (eolp) (forward-comment 1)) (cons 'column (current-column))))) + (`(:before . " @ ") + (save-excursion + (skip-chars-forward " \t") + (cons 'column (current-column)))) (`(:before . "do") (ruby-smie--indent-to-stmt)) (`(:before . ".") (if (smie-rule-sibling-p) diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 2ca0e482797..99482433145 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -379,3 +379,20 @@ foo(:bar => 'd' => %w(e f) } } + +# Bug#17050 + +return render json: { + errors: { base: [message] }, + copying: copying + }, + status: 400 + +top test( + some, + top, + test) + +foo bar, { + tee: qux + } -- 2.11.4.GIT