summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-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 d5dd137..098ddd5 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)