Calling `end-of-defun' on a python file will now do the correct thing,
even for cases like this:
def fib(n):
if n < 2:
# base cases
return n
else:
return fib(n - 2) + fib(n - 1)
(while (and (forward-line 1)
(not (eobp))
(or (not (current-word))
- (> (current-indentation) beg-defun-indent))))
+ ;; This checks if the indentation is less than the base
+ ;; one and if the line is not a comment
+ (or (> (current-indentation) beg-defun-indent)
+ (equal
+ (char-after
+ (+ (point) (current-indentation))) ?#)))))
(python-util-forward-comment)
(goto-char (line-beginning-position))))