From 11187ce939d94c3a2f6d9239114c2696a8271834 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 26 Nov 1998 08:25:51 +0000 Subject: 1.1c9 - 1.1c final, hopefully git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/ruby-mode.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sample') diff --git a/sample/ruby-mode.el b/sample/ruby-mode.el index 254851b782..8bf843c1ea 100644 --- a/sample/ruby-mode.el +++ b/sample/ruby-mode.el @@ -142,7 +142,7 @@ The variable ruby-indent-level controls the amount of indentation. (interactive) (kill-all-local-variables) (use-local-map ruby-mode-map) - (setq mode-name "ruby") + (setq mode-name "Ruby") (setq major-mode 'ruby-mode) (ruby-mode-variables) (run-hooks 'ruby-mode-hook)) @@ -209,7 +209,7 @@ The variable ruby-indent-level controls the amount of indentation. (looking-at ruby-block-mid-re)) (progn (goto-char (match-end 0)) - (looking-at "[^_]"))))))))) + (looking-at "\\>"))))))))) (defun ruby-parse-region (start end) (let ((indent-point end) @@ -464,6 +464,12 @@ The variable ruby-indent-level controls the amount of indentation. (setq bol (point)) (end-of-line) (skip-chars-backward " \t") + (and (re-search-backward "#" (save-excursion + (beginning-of-line) + (point)) t) + (setq state (ruby-parse-region parse-start (point))) + (nth 0 state) + (goto-char (nth 0 state))) (or (bobp) (forward-char -1)) (and (or (and (looking-at ruby-symbol-re) @@ -473,7 +479,7 @@ 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) - (or (not (or (eq ?/ (char-after (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)))) -- cgit v1.2.3