aboutsummaryrefslogtreecommitdiffstats
path: root/misc/ruby-electric.el
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ruby-electric.el')
-rw-r--r--misc/ruby-electric.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el
index bbdfbb7c60..95644e24cd 100644
--- a/misc/ruby-electric.el
+++ b/misc/ruby-electric.el
@@ -176,14 +176,11 @@ strings. Note that you must have Font Lock enabled."
((ruby-electric-string-at-point-p)
(if (eq last-command-event ?{)
(save-excursion
- (when (not (char-equal ?\# (preceding-char)))
- (kill-region (point) (1- (point)))
- (insert "#"))))
- (save-excursion
- (backward-char 1)
- (when (char-equal ?\# (preceding-char))
- (forward-char 1)
- (insert "}")))))))
+ (backward-char 1)
+ (or (char-equal ?\# (preceding-char))
+ (insert "#"))
+ (forward-char 1)
+ (insert "}")))))))
(defun ruby-electric-matching-char(arg)
(interactive "P")