Commit 50620051 authored by Fabián Ezequiel Gallina's avatar Fabián Ezequiel Gallina
Browse files

* progmodes/python.el (python-nav-end-of-statement): Fix

cornercase when handling multiline strings.
parent c4dd9efc
2013-01-10 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-nav-end-of-statement): Fix
cornercase when handling multiline strings.
2013-01-10 Glenn Morris <rgm@gnu.org> 2013-01-10 Glenn Morris <rgm@gnu.org>
   
* emacs-lisp/authors.el (authors-ignored-files) * emacs-lisp/authors.el (authors-ignored-files)
......
...@@ -1188,7 +1188,16 @@ of the statement." ...@@ -1188,7 +1188,16 @@ of the statement."
(not (eobp)) (not (eobp))
(cond ((setq string-start (python-syntax-context 'string)) (cond ((setq string-start (python-syntax-context 'string))
(goto-char string-start) (goto-char string-start)
(python-nav-end-of-statement t)) (if (python-syntax-context 'paren)
;; Ended up inside a paren, roll again.
(python-nav-end-of-statement t)
;; This is not inside a paren, move to the
;; end of this string.
(goto-char (+ (point)
(python-syntax-count-quotes
(char-after (point)) (point))))
(or (re-search-forward (rx (syntax string-delimiter)) nil t)
(goto-char (point-max)))))
((python-syntax-context 'paren) ((python-syntax-context 'paren)
;; The statement won't end before we've escaped ;; The statement won't end before we've escaped
;; at least one level of parenthesis. ;; at least one level of parenthesis.
...@@ -1302,7 +1311,7 @@ backward to previous block." ...@@ -1302,7 +1311,7 @@ backward to previous block."
"Safe version of standard `forward-sexp'. "Safe version of standard `forward-sexp'.
When ARG > 0 move forward, else if ARG is < 0." When ARG > 0 move forward, else if ARG is < 0."
(or arg (setq arg 1)) (or arg (setq arg 1))
(let ((forward-sexp-function nil) (let ((forward-sexp-function)
(paren-regexp (paren-regexp
(if (> arg 0) (python-rx close-paren) (python-rx open-paren))) (if (> arg 0) (python-rx close-paren) (python-rx open-paren)))
(search-fn (search-fn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment