diff options
| author | kobarity | 2022-08-07 16:10:26 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-08-07 16:10:58 +0200 |
| commit | 11e6c12def5e617fb07d604e82c9bf5289c6e827 (patch) | |
| tree | 819526971489cc7426cb411136744be45ada52dd /lisp/progmodes/python.el | |
| parent | 75929535530d7c5ab48565a33b33b4e84026b368 (diff) | |
| download | emacs-11e6c12def5e617fb07d604e82c9bf5289c6e827.tar.gz emacs-11e6c12def5e617fb07d604e82c9bf5289c6e827.zip | |
Fix blank/comment line handling in python-nav-beginning-of-block
* lisp/progmodes/python.el (python-nav-beginning-of-block): Fix
handling of blank/comment line right after block start (bug#57038).
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 27bdbae3113..88b19c88cd9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1761,16 +1761,16 @@ backward to previous statement." | |||
| 1761 | "Move to start of current block." | 1761 | "Move to start of current block." |
| 1762 | (interactive "^") | 1762 | (interactive "^") |
| 1763 | (let ((starting-pos (point))) | 1763 | (let ((starting-pos (point))) |
| 1764 | ;; Go to first line beginning a statement | ||
| 1765 | (while (and (not (bobp)) | ||
| 1766 | (or (and (python-nav-beginning-of-statement) nil) | ||
| 1767 | (python-info-current-line-comment-p) | ||
| 1768 | (python-info-current-line-empty-p))) | ||
| 1769 | (forward-line -1)) | ||
| 1764 | (if (progn | 1770 | (if (progn |
| 1765 | (python-nav-beginning-of-statement) | 1771 | (python-nav-beginning-of-statement) |
| 1766 | (looking-at (python-rx block-start))) | 1772 | (looking-at (python-rx block-start))) |
| 1767 | (point-marker) | 1773 | (point-marker) |
| 1768 | ;; Go to first line beginning a statement | ||
| 1769 | (while (and (not (bobp)) | ||
| 1770 | (or (and (python-nav-beginning-of-statement) nil) | ||
| 1771 | (python-info-current-line-comment-p) | ||
| 1772 | (python-info-current-line-empty-p))) | ||
| 1773 | (forward-line -1)) | ||
| 1774 | (let ((block-matching-indent | 1774 | (let ((block-matching-indent |
| 1775 | (- (current-indentation) python-indent-offset))) | 1775 | (- (current-indentation) python-indent-offset))) |
| 1776 | (while | 1776 | (while |