[前][次][番号順一覧][スレッド一覧]

ruby-changes:26843

From: knu <ko1@a...>
Date: Tue, 22 Jan 2013 23:05:54 +0900 (JST)
Subject: [ruby-changes:26843] knu:r38895 (trunk): Fix ruby-electric-curlies.

knu	2013-01-22 23:05:40 +0900 (Tue, 22 Jan 2013)

  New Revision: 38895

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38895

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/misc/ruby-electric.el

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38894)
+++ ChangeLog	(revision 38895)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jan 22 22:58:03 2013  Akinori MUSHA  <knu@i...>
+
+	* 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@r...>
 
 	* tool/mkconfig.rb: BASERUBY is transient at core build.
Index: misc/ruby-electric.el
===================================================================
--- misc/ruby-electric.el	(revision 38894)
+++ misc/ruby-electric.el	(revision 38895)
@@ -176,14 +176,11 @@ strings. Note that you must have Font Lo https://github.com/ruby/ruby/blob/trunk/misc/ruby-electric.el#L176
             ((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")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]