diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-26 08:25:51 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-26 08:25:51 +0000 |
commit | 11187ce939d94c3a2f6d9239114c2696a8271834 (patch) | |
tree | cfa74a6ea96d9652aae8da349eec2da41b2aca64 /sample | |
parent | 8271cacad706ed0d7741889faebb0c19270b8370 (diff) |
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
Diffstat (limited to 'sample')
-rw-r--r-- | sample/ruby-mode.el | 12 |
1 files changed, 9 insertions, 3 deletions
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)))) |