aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 915b52ce04d..62870f9085b 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3091,7 +3091,12 @@ you are doing."
3091 ;; Stop collecting nodes after moving to a position with 3091 ;; Stop collecting nodes after moving to a position with
3092 ;; indentation equaling min-indent. This is specially 3092 ;; indentation equaling min-indent. This is specially
3093 ;; useful for navigating nested definitions recursively. 3093 ;; useful for navigating nested definitions recursively.
3094 tree) 3094 (if (> num-children 0)
3095 tree
3096 ;; When there are no children, the collected tree is a
3097 ;; single node intended to be added in the list of defuns
3098 ;; of its parent.
3099 (car tree)))
3095 (t 3100 (t
3096 (python-imenu--build-tree 3101 (python-imenu--build-tree
3097 min-indent 3102 min-indent
@@ -3131,7 +3136,7 @@ you are doing."
3131 (cons 3136 (cons
3132 (prog1 3137 (prog1
3133 (python-imenu--build-tree 3138 (python-imenu--build-tree
3134 prev-indent indent 1 (list (cons label pos))) 3139 prev-indent indent 0 (list (cons label pos)))
3135 ;; Adjustment: after scanning backwards 3140 ;; Adjustment: after scanning backwards
3136 ;; for all deeper children, we need to 3141 ;; for all deeper children, we need to
3137 ;; continue our scan for a parent from 3142 ;; continue our scan for a parent from