[前][次][番号順一覧][スレッド一覧]

ruby-changes:19269

From: nobu <ko1@a...>
Date: Wed, 20 Apr 2011 00:02:23 +0900 (JST)
Subject: [ruby-changes:19269] Ruby:r31308 (trunk): * misc/ruby-mode.el (ruby-parse-partial): use position of open paren.

nobu	2011-04-20 00:02:16 +0900 (Wed, 20 Apr 2011)

  New Revision: 31308

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31308

  Log:
    * misc/ruby-mode.el (ruby-parse-partial): use position of open paren.

  Modified files:
    trunk/ChangeLog
    trunk/misc/ruby-mode.el
    trunk/test/misc/test_ruby_mode.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31307)
+++ ChangeLog	(revision 31308)
@@ -1,3 +1,7 @@
+Wed Apr 20 00:02:13 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* misc/ruby-mode.el (ruby-parse-partial): use position of open paren.
+
 Tue Apr 19 01:00:21 2011  Tajima Akio <artonx@y...>
 
 	* test/ruby/test_io.rb (TestIO#test_cross_thread_close_fd):
Index: misc/ruby-mode.el
===================================================================
--- misc/ruby-mode.el	(revision 31307)
+++ misc/ruby-mode.el	(revision 31308)
@@ -556,7 +556,7 @@
               (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 @@
        ((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)
Index: test/misc/test_ruby_mode.rb
===================================================================
--- test/misc/test_ruby_mode.rb	(revision 31307)
+++ test/misc/test_ruby_mode.rb	(revision 31308)
@@ -147,5 +147,21 @@
       |  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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]