diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-19 15:02:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-19 15:02:16 +0000 |
commit | d9e6b7d6a5e81afb588d79ef923b70890cdec4ba (patch) | |
tree | 086f54f724ee2a864e8ac528fd715869afe18ebf | |
parent | 86576c8f28cbb2fec257c7cc46307954c18e39ce (diff) | |
download | ruby-d9e6b7d6a5e81afb588d79ef923b70890cdec4ba.tar.gz |
* misc/ruby-mode.el (ruby-parse-partial): use position of open paren.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | misc/ruby-mode.el | 4 | ||||
-rw-r--r-- | test/misc/test_ruby_mode.rb | 16 |
3 files changed, 22 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Wed Apr 20 00:02:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * misc/ruby-mode.el (ruby-parse-partial): use position of open paren. + Tue Apr 19 01:00:21 2011 Tajima Akio <artonx@yahoo.co.jp> * test/ruby/test_io.rb (TestIO#test_cross_thread_close_fd): diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index c799d8c52c..187d8a583a 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -556,7 +556,7 @@ Also ignores spaces after parenthesis when 'space." (progn (and (eq deep 'space) (looking-at ".\\s +[^# \t\n]") (setq pnt (1- (match-end 0)))) - (setq nest (cons (cons (char-after (point)) pnt) nest)) + (setq nest (cons (cons (char-after (point)) (point)) nest)) (setq pcol (cons (cons pnt depth) pcol)) (setq depth 0)) (setq nest (cons (cons (char-after (point)) pnt) nest)) @@ -566,7 +566,7 @@ Also ignores spaces after parenthesis when 'space." ((looking-at "[])}]") (if (ruby-deep-indent-paren-p (matching-paren (char-after)) (if nest - (1- (cdr (nth 0 nest))) + (cdr (nth 0 nest)) (save-excursion (forward-char) (ruby-backward-sexp) diff --git a/test/misc/test_ruby_mode.rb b/test/misc/test_ruby_mode.rb index 3e2a62cb76..5723dbdaa3 100644 --- a/test/misc/test_ruby_mode.rb +++ b/test/misc/test_ruby_mode.rb @@ -147,5 +147,21 @@ class TestRubyMode | end |') end + + def test_array_after_paren_and_space + assert_indent(' + |class A + | def foo + | foo( []) + | end + |end + |', ' + |class A + | def foo + |foo( []) + |end + | end + |') + end end end if TestRubyMode::EMACS |