mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -08:00
Fix python navigation problem with an empty line in nested defun
* lisp/progmodes/python.el (python-nav--beginning-of-defun): Fix bug when point is on an empty line (bug#56600).
This commit is contained in:
parent
9b5eb661bf
commit
35d0a2e0a7
2 changed files with 48 additions and 15 deletions
|
|
@ -1454,21 +1454,24 @@ With positive ARG search backwards, else search forwards."
|
|||
(line-beg-pos (line-beginning-position))
|
||||
(line-content-start (+ line-beg-pos (current-indentation)))
|
||||
(pos (point-marker))
|
||||
(min-indentation (+ (current-indentation)
|
||||
(if (python-info-looking-at-beginning-of-defun)
|
||||
python-indent-offset 0)))
|
||||
(min-indentation (if (python-info-current-line-empty-p)
|
||||
most-positive-fixnum
|
||||
(current-indentation)))
|
||||
(body-indentation
|
||||
(and (> arg 0)
|
||||
(save-excursion
|
||||
(while (and
|
||||
(or (not (python-info-looking-at-beginning-of-defun))
|
||||
(>= (current-indentation) min-indentation))
|
||||
(setq min-indentation
|
||||
(min min-indentation (current-indentation)))
|
||||
(python-nav-backward-block)))
|
||||
(or (and (python-info-looking-at-beginning-of-defun)
|
||||
(+ (current-indentation) python-indent-offset))
|
||||
0))))
|
||||
(or (and (python-info-looking-at-beginning-of-defun)
|
||||
(+ (current-indentation) python-indent-offset))
|
||||
(save-excursion
|
||||
(while
|
||||
(and
|
||||
(python-nav-backward-block)
|
||||
(or (not (python-info-looking-at-beginning-of-defun))
|
||||
(>= (current-indentation) min-indentation))
|
||||
(setq min-indentation
|
||||
(min min-indentation (current-indentation)))))
|
||||
(or (and (python-info-looking-at-beginning-of-defun)
|
||||
(+ (current-indentation) python-indent-offset))
|
||||
0)))))
|
||||
(found
|
||||
(progn
|
||||
(when (and (python-info-looking-at-beginning-of-defun nil t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue