diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-01-31 14:19:02 -0200 |
---|---|---|
committer | Andrey Nering <andrey.nering@gmail.com> | 2016-02-04 18:21:47 -0200 |
commit | 2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1 (patch) | |
tree | 5d09fae4e0f0be52ec38437070433623c89f7006 /routers/repo/view.go | |
parent | 137a49e8342ab207c8570fc18b7c81b5fa9789ab (diff) | |
download | gitea-2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1.tar.gz gitea-2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1.zip |
Enable sintax highlighting on diff view. Close #733
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r-- | routers/repo/view.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 25e312b1c1..6a4ad64642 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -19,6 +19,7 @@ import ( "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/template" + "github.com/gogits/gogs/modules/template/highlight" ) const ( @@ -79,7 +80,7 @@ func Home(ctx *middleware.Context) { ctx.Data["FileSize"] = blob.Size() ctx.Data["IsFile"] = true ctx.Data["FileName"] = blob.Name() - ctx.Data["HighlightClass"] = template.FileNameToHighlightClass(blob.Name()) + ctx.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name()) ctx.Data["FileLink"] = rawLink + "/" + treename buf := make([]byte, 1024) |