Commit 5fb34352 authored by nitishch's avatar nitishch Committed by Noam Postavsky

Fix python-shell-send-defun at start of buffer (Bug#30822)

* lisp/progmodes/python.el (python-shell-send-defun): Handle the case
when we hit the beginning of buffer.

Copyright-paperwork-exempt: yes
parent 8df23a82
......@@ -3163,9 +3163,12 @@ t when called interactively."
(beginning-of-line 1))
(> (current-indentation) 0)))
(when (not arg)
(while (and (forward-line -1)
(looking-at (python-rx decorator))))
(forward-line 1))
(while (and
(eq (forward-line -1) 0)
(if (looking-at (python-rx decorator))
(forward-line 1)
(or (python-nav-end-of-defun)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment