1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* misc/ruby-mode.el (ruby-parse-partial): fix indent after aref.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-03-09 14:06:15 +00:00
parent 4df71924e4
commit 862048e28d
3 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Mar 9 23:06:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-parse-partial): fix indent after aref.
Wed Mar 9 12:50:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when

View file

@ -602,7 +602,12 @@ The variable ruby-indent-level controls the amount of indentation.
)
((looking-at "[])}]")
(if (ruby-deep-indent-paren-p (matching-paren (char-after))
(save-excursion (ruby-backward-sexp) (point)))
(if nest
(1- (cdr (nth 0 nest)))
(save-excursion
(forward-char)
(ruby-backward-sexp)
(point))))
(setq depth (cdr (car pcol)) pcol (cdr pcol))
(setq depth (1- depth)))
(setq nest (cdr nest))

View file

@ -132,5 +132,17 @@ class TestRubyMode
| end
|')
end
def test_array_literal
assert_indent('
|begin
| a[b]
|end
|', '
|begin
| a[b]
| end
|')
end
end
end if TestRubyMode::EMACS