From 0e887af2d16740798a1ced5f6af0b58bd070c40b Mon Sep 17 00:00:00 2001 From: FlorianBen Date: Sun, 4 Aug 2019 10:11:27 +0200 Subject: [PATCH] Fix specific highlighting (CMakeLists.txt ...) (#7686) * Fix specific highlighting. * Highlighting CMakeLists.txt: remove case sensitive checks. use lowercase checks instead. --- modules/highlight/highlight.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go index cb52f6ac2..433448056 100644 --- a/modules/highlight/highlight.go +++ b/modules/highlight/highlight.go @@ -19,9 +19,11 @@ var ( } // File names that are representing highlight classes. - highlightFileNames = map[string]bool{ - "dockerfile": true, - "makefile": true, + highlightFileNames = map[string]string{ + "dockerfile": "dockerfile", + "makefile": "makefile", + "gnumakefile": "makefile", + "cmakelists.txt": "cmake", } // Extensions that are same as highlight classes. @@ -87,8 +89,8 @@ func FileNameToHighlightClass(fname string) string { return "nohighlight" } - if highlightFileNames[fname] { - return fname + if name, ok := highlightFileNames[fname]; ok { + return name } ext := path.Ext(fname)