1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* misc/ruby-electric.el (ruby-electric-setup-keymap): Make

backquotes electric as well.  It was listed in
  ruby-electric-expand-delimiters-list but not activated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2013-05-18 17:38:08 +00:00
parent 616084fd97
commit 041224017c
2 changed files with 7 additions and 2 deletions

View file

@ -1,4 +1,8 @@
Sun May 19 02:30:00 2013 Akinori MUSHA <knu@iDaemons.org>
Sun May 19 02:33:09 2013 Akinori MUSHA <knu@iDaemons.org>
* misc/ruby-electric.el (ruby-electric-setup-keymap): Make
backquotes electric as well. It was listed in
ruby-electric-expand-delimiters-list but not activated.
* misc/ruby-electric.el (ruby-electric-delete-backward-char):
Introduce electric DEL that deletes what the previous electric

View file

@ -120,6 +120,7 @@ strings. Note that you must have Font Lock enabled."
(define-key ruby-mode-map "[" 'ruby-electric-matching-char)
(define-key ruby-mode-map "\"" 'ruby-electric-matching-char)
(define-key ruby-mode-map "\'" 'ruby-electric-matching-char)
(define-key ruby-mode-map "`" 'ruby-electric-matching-char)
(define-key ruby-mode-map "}" 'ruby-electric-closing-char)
(define-key ruby-mode-map ")" 'ruby-electric-closing-char)
(define-key ruby-mode-map "]" 'ruby-electric-closing-char)
@ -279,7 +280,7 @@ strings. Note that you must have Font Lock enabled."
(ruby-electric-string-at-point-p)))
(save-excursion (insert closing))
(and (eq last-command 'ruby-electric-matching-char)
(char-equal (following-char) closing) ;; repeated ' or "
(char-equal (following-char) closing) ;; repeated quotes
(delete-forward-char 1))
(setq this-command 'self-insert-command)))
((ruby-electric-code-at-point-p)