File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 124124 :group 'haskell-decl-scan
125125 :type 'boolean )
126126
127+ (defcustom haskell-decl-scan-sort-imenu t
128+ " Whether to sort the candidates in imenu."
129+ :group 'haskell-decl-scan
130+ :type 'boolean )
131+
127132; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
128133; ; General declaration scanning functions.
129134
@@ -562,15 +567,21 @@ datatypes) in a Haskell file for the `imenu' package."
562567 (import . " Imports" ) (class . " Classes" )))
563568 (when-let ((curr-alist (gethash (car type) imenu)))
564569 (push (cons (cdr type)
565- (sort curr-alist 'haskell-ds-imenu-label-cmp ))
570+ (if haskell-decl-scan-sort-imenu
571+ (sort curr-alist 'haskell-ds-imenu-label-cmp )
572+ (reverse curr-alist)))
566573 index-alist)))
567574 (when-let ((var-alist (gethash 'variable imenu)))
568575 (if haskell-decl-scan-bindings-as-variables
569576 (push (cons " Variables"
570- (sort var-alist 'haskell-ds-imenu-label-cmp ))
577+ (if haskell-decl-scan-sort-imenu
578+ (sort var-alist 'haskell-ds-imenu-label-cmp )
579+ (reverse var-alist)))
571580 index-alist)
572581 (setq index-alist (append index-alist
573- (sort var-alist 'haskell-ds-imenu-label-cmp )))))
582+ (if haskell-decl-scan-sort-imenu
583+ (sort var-alist 'haskell-ds-imenu-label-cmp )
584+ (reverse var-alist))))))
574585 ; ; Return the alist.
575586 index-alist))
576587
You can’t perform that action at this time.
0 commit comments