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:
parent
4df71924e4
commit
862048e28d
3 changed files with 22 additions and 1 deletions
|
@ -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>
|
Wed Mar 9 12:50:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
|
* ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
|
||||||
|
|
|
@ -602,7 +602,12 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
)
|
)
|
||||||
((looking-at "[])}]")
|
((looking-at "[])}]")
|
||||||
(if (ruby-deep-indent-paren-p (matching-paren (char-after))
|
(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 (cdr (car pcol)) pcol (cdr pcol))
|
||||||
(setq depth (1- depth)))
|
(setq depth (1- depth)))
|
||||||
(setq nest (cdr nest))
|
(setq nest (cdr nest))
|
||||||
|
|
|
@ -132,5 +132,17 @@ class TestRubyMode
|
||||||
| end
|
| end
|
||||||
|')
|
|')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_array_literal
|
||||||
|
assert_indent('
|
||||||
|
|begin
|
||||||
|
| a[b]
|
||||||
|
|end
|
||||||
|
|', '
|
||||||
|
|begin
|
||||||
|
| a[b]
|
||||||
|
| end
|
||||||
|
|')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end if TestRubyMode::EMACS
|
end if TestRubyMode::EMACS
|
||||||
|
|
Loading…
Add table
Reference in a new issue