diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-22 14:05:40 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-22 14:05:40 +0000 |
commit | 9545483ad3b5fcc414dcdd681aca5cbb778ff858 (patch) | |
tree | 99a6204b17bc14c528889bcc5282153613d74b36 /misc | |
parent | 7d6f22f4cd287aa89a4fe714f05abed7d91eb6a6 (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')
-rw-r--r-- | misc/ruby-electric.el | 13 |
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") |