From a60f506dd7217b6a6c7ea6934e308c91cd9dabac Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Sun, 12 Jul 2020 14:25:05 -0400 Subject: [PATCH] Syntax highlight expanded code blobs (#12223) Expanded code in diffs wasn't being highlighted properly because it wasn't passing the filename to highlighting code. Fixes #12218 --- routers/repo/compare.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 0ee0b0f73b..fb78ebdeac 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -605,7 +605,8 @@ func ExcerptBlob(ctx *context.Context) { return } section := &gitdiff.DiffSection{ - Name: filePath, + FileName: filePath, + Name: filePath, } if direction == "up" && (idxLeft-lastLeft) > chunkSize { idxLeft -= chunkSize