diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-07-26 14:02:53 -0600 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-07-26 14:02:53 -0600 |
| commit | cc231cbe45d27a1906d268fb72d3b4105a2e9c65 (patch) | |
| tree | c011828e2a3a18e77eaa8849e3cccb805d798f42 /lisp/progmodes/python.el | |
| parent | b34a529f177a6ea32da5cb1254f91bf9d71838db (diff) | |
| parent | fec9206062b420aca84f53d05a72c3ee43244022 (diff) | |
| download | emacs-cc231cbe45d27a1906d268fb72d3b4105a2e9c65.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 9 |
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." ;; Stop collecting nodes after moving to a position with ;; indentation equaling min-indent. This is specially ;; useful for navigating nested definitions recursively. - tree) + (if (> num-children 0) + tree + ;; When there are no children, the collected tree is a + ;; single node intended to be added in the list of defuns + ;; of its parent. + (car tree))) (t (python-imenu--build-tree min-indent @@ -3131,7 +3136,7 @@ you are doing." (cons (prog1 (python-imenu--build-tree - prev-indent indent 1 (list (cons label pos))) + prev-indent indent 0 (list (cons label pos))) ;; Adjustment: after scanning backwards ;; for all deeper children, we need to ;; continue our scan for a parent from |
