File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1792,7 +1792,7 @@ local bindings to py-newline-and-indent."))
17921792(defun py-parse-state ()
17931793 (save-excursion
17941794 (let ((here (point ))
1795- pps done)
1795+ pps done ci )
17961796 (while (not done)
17971797 ; ; back up to the first preceding line (if any; else start of
17981798 ; ; buffer) that begins with a popular Python keyword, or a
@@ -1801,11 +1801,15 @@ local bindings to py-newline-and-indent."))
18011801 ; ; at a non-zero nesting level. It may be slow for people who
18021802 ; ; write huge code blocks or huge lists ... tough beans.
18031803 (re-search-backward py-parse-state-re nil 'move )
1804+ (setq ci (current-indentation ))
18041805 (beginning-of-line )
18051806 (save-excursion
18061807 (setq pps (parse-partial-sexp (point ) here)))
18071808 ; ; make sure we don't land inside a triple-quoted string
1808- (setq done (or (not (nth 3 pps)) (bobp ))))
1809+ (setq done (or (zerop ci)
1810+ (not (nth 3 pps))
1811+ (bobp )))
1812+ )
18091813 pps)))
18101814
18111815; ; if point is at a non-zero nesting level, returns the number of the
You can’t perform that action at this time.
0 commit comments