mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-23 22:20:24 -08:00
* lisp/progmodes/python.el (python-nav-beginning-of-statement): Speed
up. Fixes: debbugs:15295
This commit is contained in:
parent
9ebada6af6
commit
89c868adee
2 changed files with 20 additions and 9 deletions
|
|
@ -1279,15 +1279,21 @@ nested definitions."
|
|||
(defun python-nav-beginning-of-statement ()
|
||||
"Move to start of current statement."
|
||||
(interactive "^")
|
||||
(while (and (or (back-to-indentation) t)
|
||||
(not (bobp))
|
||||
(when (or
|
||||
(save-excursion
|
||||
(forward-line -1)
|
||||
(python-info-line-ends-backslash-p))
|
||||
(python-syntax-context 'string)
|
||||
(python-syntax-context 'paren))
|
||||
(forward-line -1))))
|
||||
(back-to-indentation)
|
||||
(let* ((ppss (syntax-ppss))
|
||||
(context-point
|
||||
(or
|
||||
(python-syntax-context 'paren ppss)
|
||||
(python-syntax-context 'string ppss))))
|
||||
(cond ((bobp))
|
||||
(context-point
|
||||
(goto-char context-point)
|
||||
(python-nav-beginning-of-statement))
|
||||
((save-excursion
|
||||
(forward-line -1)
|
||||
(python-info-line-ends-backslash-p))
|
||||
(forward-line -1)
|
||||
(python-nav-beginning-of-statement))))
|
||||
(point-marker))
|
||||
|
||||
(defun python-nav-end-of-statement (&optional noend)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue