diff options
Diffstat (limited to 'misc/ruby-mode.el')
-rw-r--r-- | misc/ruby-mode.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 8d9df41a4a..7728734b39 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -685,15 +685,18 @@ The variable ruby-indent-level controls the amount of indentation. (setq bol (point)) (end-of-line) (skip-chars-backward " \t") - (let ((pos (point))) - (while (and (re-search-backward "#" bol t) - (ruby-special-char-p)) - (forward-char -1)) + (let (end (pos (point))) + (beginning-of-line) + (while (and (re-search-forward "#" pos t) + (setq end (1- (point))) + (ruby-special-char-p end)) + (setq end nil)) + (goto-char (or end pos)) (skip-chars-backward " \t") (and (setq state (ruby-parse-region parse-start (point))) (nth 0 state) - (setq begin (nth 1 state)) + (setq begin (cdr (nth 1 state))) (goto-char pos))) (or (bobp) (forward-char -1)) (and |