summaryrefslogtreecommitdiff
path: root/misc/ruby-electric.el
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-22 14:05:40 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-22 14:05:40 +0000
commit9545483ad3b5fcc414dcdd681aca5cbb778ff858 (patch)
tree99a6204b17bc14c528889bcc5282153613d74b36 /misc/ruby-electric.el
parent7d6f22f4cd287aa89a4fe714f05abed7d91eb6a6 (diff)
Fix ruby-electric-curlies.
* misc/ruby-electric.el (ruby-electric-curlies): Fix the bug where an open curly is always replaced with a hash sign. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 bbdfbb7..95644e2 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")