diff options
| author | Fabián Ezequiel Gallina | 2013-01-10 00:44:12 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2013-01-10 00:44:12 -0300 |
| commit | 50620051800d14a47558fb4379d7cbae5d81f6a1 (patch) | |
| tree | 5606e4a930960aa3d067d0e9213974d34ff8107b /lisp/progmodes/python.el | |
| parent | c4dd9efc9ed3f7de8f4ee74b6d47f65ad72320cf (diff) | |
| download | emacs-50620051800d14a47558fb4379d7cbae5d81f6a1.tar.gz emacs-50620051800d14a47558fb4379d7cbae5d81f6a1.zip | |
* progmodes/python.el (python-nav-end-of-statement): Fix
cornercase when handling multiline strings.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 13 |
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'. |
| 1303 | When ARG > 0 move forward, else if ARG is < 0." | 1312 | When 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 |