From 00b44014f00b339352b1d79c3c9136b287147a94 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 24 Sep 2005 16:47:20 +0000 Subject: * 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 --- misc/ruby-mode.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'misc') 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")) -- cgit v1.2.3