From d160c7e565ef3c3429ca601b5a10b13949579b36 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 21 Feb 2016 18:45:24 -0300 Subject: Little refactoring of diff highlight. Moving cache variable to template instead of in the struct. --- templates/repo/diff_box.tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/repo/diff_box.tmpl b/templates/repo/diff_box.tmpl index f96ebda5..455f0700 100644 --- a/templates/repo/diff_box.tmpl +++ b/templates/repo/diff_box.tmpl @@ -34,6 +34,7 @@ {{range $i, $file := .Diff.Files}} + {{$highlightClass := $file.GetHighlightClass}}

@@ -76,13 +77,13 @@ {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}} -
{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
+
{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
{{if $line.RightIdx}}{{$line.RightIdx}}{{end}} -
{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
+
{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
{{end}} @@ -104,7 +105,7 @@ {{end}} -
{{$section.GetComputedInlineDiffFor $line}}
+
{{$section.GetComputedInlineDiffFor $line}}
{{end}} -- cgit v1.2.3