aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 172193266ca..0e5f4c82090 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1198,7 +1198,16 @@ of the statement."
1198 (not (eobp)) 1198 (not (eobp))
1199 (cond ((setq string-start (python-syntax-context 'string)) 1199 (cond ((setq string-start (python-syntax-context 'string))
1200 (goto-char string-start) 1200 (goto-char string-start)
1201 (python-nav-end-of-statement t)) 1201 (if (python-syntax-context 'paren)
1202 ;; Ended up inside a paren, roll again.
1203 (python-nav-end-of-statement t)
1204 ;; This is not inside a paren, move to the
1205 ;; end of this string.
1206 (goto-char (+ (point)
1207 (python-syntax-count-quotes
1208 (char-after (point)) (point))))
1209 (or (re-search-forward (rx (syntax string-delimiter)) nil t)
1210 (goto-char (point-max)))))
1202 ((python-syntax-context 'paren) 1211 ((python-syntax-context 'paren)
1203 ;; The statement won't end before we've escaped 1212 ;; The statement won't end before we've escaped
1204 ;; at least one level of parenthesis. 1213 ;; at least one level of parenthesis.
@@ -1312,7 +1321,7 @@ backward to previous block."
1312 "Safe version of standard `forward-sexp'. 1321 "Safe version of standard `forward-sexp'.
1313When ARG > 0 move forward, else if ARG is < 0." 1322When ARG > 0 move forward, else if ARG is < 0."
1314 (or arg (setq arg 1)) 1323 (or arg (setq arg 1))
1315 (let ((forward-sexp-function nil) 1324 (let ((forward-sexp-function)
1316 (paren-regexp 1325 (paren-regexp
1317 (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) 1326 (if (> arg 0) (python-rx close-paren) (python-rx open-paren)))
1318 (search-fn 1327 (search-fn