зеркало из https://github.com/github/ruby.git
* 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:
Родитель
4df71924e4
Коммит
862048e28d
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче