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 124
124
:group 'haskell-decl-scan
125
125
:type 'boolean )
126
126
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
+
127
132
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
128
133
; ; General declaration scanning functions.
129
134
@@ -562,15 +567,21 @@ datatypes) in a Haskell file for the `imenu' package."
562
567
(import . " Imports" ) (class . " Classes" )))
563
568
(when-let ((curr-alist (gethash (car type) imenu)))
564
569
(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)))
566
573
index-alist)))
567
574
(when-let ((var-alist (gethash 'variable imenu)))
568
575
(if haskell-decl-scan-bindings-as-variables
569
576
(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)))
571
580
index-alist)
572
581
(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))))))
574
585
; ; Return the alist.
575
586
index-alist))
576
587
You can’t perform that action at this time.
0 commit comments