diff options
| -rw-r--r-- | lisp/progmodes/python.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e4019373362..3cdfb43e35f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -568,7 +568,12 @@ START is the buffer position where the sexp starts." | |||
| 568 | (save-excursion | 568 | (save-excursion |
| 569 | (goto-char context-start) | 569 | (goto-char context-start) |
| 570 | (forward-char) | 570 | (forward-char) |
| 571 | (if (looking-at "[[:space:]]*$") | 571 | (save-restriction |
| 572 | (narrow-to-region | ||
| 573 | (line-beginning-position) | ||
| 574 | (line-end-position)) | ||
| 575 | (forward-comment 1)) | ||
| 576 | (if (looking-at "$") | ||
| 572 | (+ (current-indentation) python-indent-offset) | 577 | (+ (current-indentation) python-indent-offset) |
| 573 | (forward-comment 1) | 578 | (forward-comment 1) |
| 574 | (current-column))) | 579 | (current-column))) |