summaryrefslogtreecommitdiff
path: root/misc/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ruby-mode.el')
-rw-r--r--misc/ruby-mode.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index d5dd137af0..098ddd5e04 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -203,7 +203,12 @@ The variable ruby-indent-level controls the amount of indentation.
(looking-at "[\\[({]")
(and (not modifier) (looking-at "[!?]"))
(and (looking-at ruby-symbol-re)
- (forward-word -1)
+ (save-restriction
+ (let ((p (point)))
+ (beginning-of-line)
+ (narrow-to-region (point) p)
+ (goto-char p)
+ (forward-word -1)))
(if (and (not modifier) (bolp))
t
(if (or (looking-at ruby-block-beg-re)