diff options
Diffstat (limited to 'sample/ruby-mode.el')
-rw-r--r-- | sample/ruby-mode.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sample/ruby-mode.el b/sample/ruby-mode.el index 204654013f..d379a633c3 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)) @@ -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)))) |