diff options
| author | kobarity | 2025-01-13 22:38:42 +0900 |
|---|---|---|
| committer | Eli Zaretskii | 2025-02-15 13:24:59 +0200 |
| commit | 6491fee366f58a831689c57aa31493dd70bc2245 (patch) | |
| tree | 4bcb4b0d012cd3795b66b977b28890424d3e91fa /lisp/progmodes/python.el | |
| parent | 0f768b8843bcdbbfa1c64aeee64d2de7d62c0d13 (diff) | |
| download | emacs-6491fee366f58a831689c57aa31493dd70bc2245.tar.gz emacs-6491fee366f58a831689c57aa31493dd70bc2245.zip | |
Fix string end search in python-nav-end-of-statement
* lisp/progmodes/python.el (python-nav-end-of-statement):
Change to look for string delimiter characters and check
syntax, instead of looking for string-delimiter syntax.
* test/lisp/progmodes/python-tests.el
(python-nav-end-of-statement-5): New test. (Bug#75387)
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8a99ff0434d..a42e2b2a28a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2328,8 +2328,11 @@ of the statement." | |||
| 2328 | (setq | 2328 | (setq |
| 2329 | last-string-end | 2329 | last-string-end |
| 2330 | (or (if (eq t (nth 3 (syntax-ppss))) | 2330 | (or (if (eq t (nth 3 (syntax-ppss))) |
| 2331 | (re-search-forward | 2331 | (cl-loop |
| 2332 | (rx (syntax string-delimiter)) nil t) | 2332 | while (re-search-forward |
| 2333 | (rx (or "\"\"\"" "'''")) nil t) | ||
| 2334 | unless (python-syntax-context 'string) | ||
| 2335 | return (point)) | ||
| 2333 | (ignore-error scan-error | 2336 | (ignore-error scan-error |
| 2334 | (goto-char string-start) | 2337 | (goto-char string-start) |
| 2335 | (python-nav--lisp-forward-sexp) | 2338 | (python-nav--lisp-forward-sexp) |