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 7294984fc4a..e58dfa169ef 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1188,7 +1188,16 @@ of the statement."
1188 (not (eobp)) 1188 (not (eobp))
1189 (cond ((setq string-start (python-syntax-context 'string)) 1189 (cond ((setq string-start (python-syntax-context 'string))
1190 (goto-char string-start) 1190 (goto-char string-start)
1191 (python-nav-end-of-statement t)) 1191 (if (python-syntax-context 'paren)
1192 ;; Ended up inside a paren, roll again.
1193 (python-nav-end-of-statement t)
1194 ;; This is not inside a paren, move to the
1195 ;; end of this string.
1196 (goto-char (+ (point)
1197 (python-syntax-count-quotes
1198 (char-after (point)) (point))))
1199 (or (re-search-forward (rx (syntax string-delimiter)) nil t)
1200 (goto-char (point-max)))))
1192 ((python-syntax-context 'paren) 1201 ((python-syntax-context 'paren)
1193 ;; The statement won't end before we've escaped 1202 ;; The statement won't end before we've escaped
1194 ;; at least one level of parenthesis. 1203 ;; at least one level of parenthesis.
@@ -1302,7 +1311,7 @@ backward to previous block."
1302 "Safe version of standard `forward-sexp'. 1311 "Safe version of standard `forward-sexp'.
1303When ARG > 0 move forward, else if ARG is < 0." 1312When ARG > 0 move forward, else if ARG is < 0."
1304 (or arg (setq arg 1)) 1313 (or arg (setq arg 1))
1305 (let ((forward-sexp-function nil) 1314 (let ((forward-sexp-function)
1306 (paren-regexp 1315 (paren-regexp
1307 (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) 1316 (if (> arg 0) (python-rx close-paren) (python-rx open-paren)))
1308 (search-fn 1317 (search-fn