* misc/ruby-electric.el (ruby-electric-matching-char): Do not put
a closing quote when the quote typed does not start a string, as in $', ?\' or ?\". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fbe45fdfa2
commit
53fa01d060
@ -1,3 +1,9 @@
|
|||||||
|
Fri May 17 19:18:24 2013 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* misc/ruby-electric.el (ruby-electric-matching-char): Do not put
|
||||||
|
a closing quote when the quote typed does not start a string, as
|
||||||
|
in $', ?\' or ?\".
|
||||||
|
|
||||||
Fri May 17 18:06:15 2013 Tanaka Akira <akr@fsij.org>
|
Fri May 17 18:06:15 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* configure.in: Consider error messages to find out version option of
|
* configure.in: Consider error messages to find out version option of
|
||||||
|
@ -252,16 +252,19 @@ strings. Note that you must have Font Lock enabled."
|
|||||||
(interactive "P")
|
(interactive "P")
|
||||||
(ruby-electric-insert
|
(ruby-electric-insert
|
||||||
arg
|
arg
|
||||||
(cond
|
(let ((closing (cdr (assoc last-command-event
|
||||||
((and
|
ruby-electric-matching-delimeter-alist))))
|
||||||
(eq last-command 'ruby-electric-matching-char)
|
(cond
|
||||||
(char-equal last-command-event (following-char))) ;; repeated ' or "
|
((char-equal closing last-command-event)
|
||||||
(setq this-command 'self-insert-command)
|
(if (and (not (ruby-electric-string-at-point-p))
|
||||||
(delete-forward-char 1))
|
(progn (redisplay) (ruby-electric-string-at-point-p)))
|
||||||
(t
|
(save-excursion (insert closing))
|
||||||
(and (ruby-electric-code-at-point-p)
|
(and (eq last-command 'ruby-electric-matching-char)
|
||||||
(save-excursion (insert (cdr (assoc last-command-event
|
(char-equal (following-char) closing) ;; repeated ' or "
|
||||||
ruby-electric-matching-delimeter-alist)))))))))
|
(delete-forward-char 1))
|
||||||
|
(setq this-command 'self-insert-command)))
|
||||||
|
((ruby-electric-code-at-point-p)
|
||||||
|
(save-excursion (insert closing)))))))
|
||||||
|
|
||||||
(defun ruby-electric-closing-char(arg)
|
(defun ruby-electric-closing-char(arg)
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user