summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-24 16:47:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-24 16:47:20 +0000
commit00b44014f00b339352b1d79c3c9136b287147a94 (patch)
treeb572c07fd877bec23a2bb943bfab843ce0a6794d
parent6cffa8e4f885e314493811a6e8e837b19f520895 (diff)
* misc/ruby-mode.el (ruby-calculate-indent): arrange deep-indent
closing parenthesis at same column as the opening. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--misc/ruby-mode.el8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c57fb288d..38b5f295a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Sep 25 01:46:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-calculate-indent): arrange deep-indent
+ closing parenthesis at same column as the opening.
+
Sun Sep 25 00:42:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-expr-beg): deal with heredoc separately.
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index e68dc32f08..294424434e 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -152,7 +152,7 @@
Also ignores spaces after parenthesis when 'space."
:group 'ruby)
-(defcustom ruby-deep-indent-paren '(?\( ?\[ t)
+(defcustom ruby-deep-indent-paren '(?\( ?\[ ?\] t)
"*Deep indent lists in parenthesis when non-nil. t means continuous line.
Also ignores spaces after parenthesis when 'space."
:group 'ruby)
@@ -617,7 +617,11 @@ The variable ruby-indent-level controls the amount of indentation.
(t (setq indent (ruby-indent-size (1- indent) 1))))))
(if (nth 3 state) (goto-char (nth 3 state))
(goto-char parse-start) (back-to-indentation))
- (setq indent (ruby-indent-size (current-column) (nth 2 state))))))
+ (setq indent (ruby-indent-size (current-column) (nth 2 state))))
+ (and (eq (car (nth 1 state)) paren)
+ (ruby-deep-indent-paren-p (matching-paren paren))
+ (search-backward (char-to-string paren))
+ (setq indent (current-column)))))
((and (nth 2 state) (> (nth 2 state) 0)) ; in nest
(if (null (cdr (nth 1 state)))
(error "invalid nest"))