We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 373b6b7 commit d6bdd14Copy full SHA for d6bdd14
lexer.go
@@ -2,6 +2,7 @@ package chroma
2
3
import (
4
"fmt"
5
+ "strings"
6
)
7
8
var (
@@ -98,9 +99,11 @@ type Lexer interface {
98
99
// Lexers is a slice of lexers sortable by name.
100
type Lexers []Lexer
101
-func (l Lexers) Len() int { return len(l) }
102
-func (l Lexers) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
103
-func (l Lexers) Less(i, j int) bool { return l[i].Config().Name < l[j].Config().Name }
+func (l Lexers) Len() int { return len(l) }
+func (l Lexers) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
104
+func (l Lexers) Less(i, j int) bool {
105
+ return strings.ToLower(l[i].Config().Name) < strings.ToLower(l[j].Config().Name)
106
+}
107
108
// PrioritisedLexers is a slice of lexers sortable by priority.
109
type PrioritisedLexers []Lexer
0 commit comments