Skip to content

Commit

Permalink
Fix default type in imenu for non prog modes (#1997)
Browse files Browse the repository at this point in the history
* helm-imenu.el (helm-imenu-transformer): Do it.
  • Loading branch information
Thierry Volpiatto committed Mar 21, 2018
1 parent 9a79e0f commit 4664f42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helm-imenu.el
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,17 @@ Each car is a regexp match pattern of the imenu type string."
(defun helm-imenu-transformer (candidates)
(cl-loop for (k . v) in candidates
;; (k . v) == (symbol-name . marker)
for types = (or (helm-imenu--get-prop k)
(list "Function" k))
for bufname = (buffer-name
(pcase v
((pred overlayp) (overlay-buffer v))
((or (pred markerp) (pred integerp))
(marker-buffer v))))
for types = (or (helm-imenu--get-prop k)
(list (if (with-current-buffer bufname
(derived-mode-p 'prog-mode))
"Function"
"Top level")
k))
for disp1 = (mapconcat
(lambda (x)
(propertize
Expand Down

0 comments on commit 4664f42

Please sign in to comment.