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.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index e884e06..b5d7040 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -544,18 +544,20 @@ The variable ruby-indent-level controls the amount of indentation.
(or (not (eq ?| (char-after (point))))
(save-excursion
(or (eolp) (forward-char -1))
- (and (search-backward "|")
- (skip-chars-backward " \t\n")
- (and (not (eolp))
- (progn
- (forward-char -1)
- (not (looking-at "\\{")))
- (progn
- (forward-word -1)
- (not (looking-at "do\\>[^_]")))))))))
+ (cond
+ ((search-backward "|" nil t)
+ (skip-chars-backward " \t\n")
+ (and (not (eolp))
+ (progn
+ (forward-char -1)
+ (not (looking-at "\\{")))
+ (progn
+ (forward-word -1)
+ (not (looking-at "do\\>[^_]")))))
+ (t t))))))
(setq indent (+ indent ruby-indent-level)))))))
indent)))
-
+
(defun ruby-electric-brace (arg)
(interactive "P")
(self-insert-command (prefix-numeric-value arg))