From 7aecc2f6ca3842395436f111449dbdcdce494ad5 Mon Sep 17 00:00:00 2001 From: João Távora Date: Mon, 7 Apr 2014 00:23:45 +0100 Subject: Fix triple-quoting electricity in python-mode * lisp/progmodes/python.el (python-electric-pair-string-delimiter): Fix triple-quoting electricity. * test/automated/python-tests.el (python-triple-quote-pairing): New test. (python-syntax-after-python-backspace): New test. Fixes: debbugs:17192 --- lisp/progmodes/python.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b0102c55ffd..240cf8aff8c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3651,8 +3651,9 @@ returned as is." (let ((count 0)) (while (eq (char-before (- (point) count)) last-command-event) (cl-incf count)) - (= count 3))) - (save-excursion (insert (make-string 3 last-command-event))))) + (= count 3)) + (eq (char-after) last-command-event)) + (save-excursion (insert (make-string 2 last-command-event))))) (defvar electric-indent-inhibit) -- cgit v1.2.1