Skip to content

Commit c69adaf

Browse files
committed
Add menu titles for items in imenu
All items gathered by imenu were put at the top-level, except impls. This commit puts all items in separate menu titles, following "Impl". Fixes #93.
1 parent e6eceea commit c69adaf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

rust-mode.el

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,16 +1195,15 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
11951195
;;; Imenu support
11961196
(defvar rust-imenu-generic-expression
11971197
(append (mapcar #'(lambda (x)
1198-
(list nil (rust-re-item-def-imenu x) 1))
1199-
'("enum" "struct" "type" "mod" "fn" "trait" "macro_rules!"))
1200-
`(("Impl" ,(rust-re-item-def-imenu "impl") 1)))
1198+
(list (capitalize x) (rust-re-item-def-imenu x) 1))
1199+
'("enum" "struct" "type" "mod" "fn" "trait" "impl"))
1200+
`(("Macro" ,(rust-re-item-def-imenu "macro_rules!") 1)))
12011201
"Value for `imenu-generic-expression' in Rust mode.
12021202
1203-
Create a flat index of the item definitions in a Rust file.
1203+
Create a hierarchical index of the item definitions in a Rust file.
12041204
1205-
Imenu will show all the enums, structs, etc. at the same level.
1206-
Implementations will be shown under the `Impl` subheading. Use
1207-
idomenu (imenu with `ido-mode') for best mileage.")
1205+
Imenu will show all the enums, structs, etc. in their own subheading.
1206+
Use idomenu (imenu with `ido-mode') for best mileage.")
12081207

12091208
;;; Defun Motions
12101209

0 commit comments

Comments
 (0)