aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--misc/ruby-electric.el13
2 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 33b9f978cb..e3100134cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 22 22:58:03 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-curlies): Fix the bug where
+ an open curly is always replaced with a hash sign.
+
Mon Jan 21 15:41:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/mkconfig.rb: BASERUBY is transient at core build.
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")