summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfmdkdd <fmdkdd@gmail.com>2016-05-14 13:25:43 +0200
committerfmdkdd <fmdkdd@gmail.com>2016-05-14 13:33:59 +0200
commitc69adaf8ea5b2bdf56d7ae9a54a0a86b28fd9418 (patch)
treec5ec8b254d9aec3531e6ea96b38f601115a24f5c
parente6eceea8c7f30fbd847106f3a59d54c3ca8739a7 (diff)
downloadrust-mode-c69adaf8ea5b2bdf56d7ae9a54a0a86b28fd9418.tar.gz
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.
-rw-r--r--rust-mode.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 65fc1fd..16aaa6d 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1195,16 +1195,15 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
;;; Imenu support
(defvar rust-imenu-generic-expression
(append (mapcar #'(lambda (x)
- (list nil (rust-re-item-def-imenu x) 1))
- '("enum" "struct" "type" "mod" "fn" "trait" "macro_rules!"))
- `(("Impl" ,(rust-re-item-def-imenu "impl") 1)))
+ (list (capitalize x) (rust-re-item-def-imenu x) 1))
+ '("enum" "struct" "type" "mod" "fn" "trait" "impl"))
+ `(("Macro" ,(rust-re-item-def-imenu "macro_rules!") 1)))
"Value for `imenu-generic-expression' in Rust mode.
-Create a flat index of the item definitions in a Rust file.
+Create a hierarchical index of the item definitions in a Rust file.
-Imenu will show all the enums, structs, etc. at the same level.
-Implementations will be shown under the `Impl` subheading. Use
-idomenu (imenu with `ido-mode') for best mileage.")
+Imenu will show all the enums, structs, etc. in their own subheading.
+Use idomenu (imenu with `ido-mode') for best mileage.")
;;; Defun Motions