From 1ce6f065b519284a5ad7135a6db77fcbe1aa778a Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 10 Oct 2000 07:03:36 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- misc/ruby-mode.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'misc/ruby-mode.el') diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 787a048b37..33b88a2942 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -442,7 +442,6 @@ The variable ruby-indent-level controls the amount of indentation. (cond ((nth 0 state) ; within string (setq indent nil)) ; do nothing - ((car (nth 1 state)) ; in paren (goto-char (cdr (nth 1 state))) (if (eq (car (nth 1 state)) ?\( ) @@ -463,8 +462,7 @@ The variable ruby-indent-level controls the amount of indentation. (goto-char parse-start) (back-to-indentation) (setq indent (ruby-indent-size (current-column) (nth 2 state))))) - )) - + )) ((and (nth 2 state)(> (nth 2 state) 0)) ; in nest (if (null (cdr (nth 1 state))) (error "invalid nest")) @@ -485,7 +483,7 @@ The variable ruby-indent-level controls the amount of indentation. ((and (nth 2 state) (< (nth 2 state) 0)) ; in negative nest (setq indent (ruby-indent-size (current-column) (nth 2 state))))) - + (cond (indent (goto-char indent-point) @@ -514,7 +512,7 @@ The variable ruby-indent-level controls the amount of indentation. (setq end (point)) (beginning-of-line) (if (re-search-forward "^\\s *#" end t) - (beginning-of-line) + (forward-line 1) (setq done t)))) (setq bol (point)) (end-of-line) @@ -538,9 +536,10 @@ The variable ruby-indent-level controls the amount of indentation. (goto-char (match-end 0)) (not (looking-at "[a-z_]")))) (and (looking-at ruby-operator-re) + (not (eq (char-after (1- (point))) ??)) + (not (eq (char-after (1- (point))) ?$)) (or (not (eq ?/ (char-after (point)))) (null (nth 0 (ruby-parse-region parse-start (point))))) - (not (eq (char-after (1- (point))) ?$)) (or (not (eq ?| (char-after (point)))) (save-excursion (or (eolp) (forward-char -1)) -- cgit v1.2.3