diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl
index 0f561a8a8..5f87a4176 100644
--- a/templates/repo/diff/section_unified.tmpl
+++ b/templates/repo/diff/section_unified.tmpl
@@ -1,75 +1,77 @@
{{$file := .file}}
{{range $j, $section := $file.Sections}}
{{range $k, $line := $section.Lines}}
-
- {{if eq .GetType 4}}
-
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
-
- {{svg "octicon-fold-down" 16}}
-
+ {{if or $.root.AfterCommitID (ne .GetType 4)}}
+ |
+ {{if eq .GetType 4}}
+
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
+
+ {{svg "octicon-fold-down" 16}}
+
+ {{end}}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
+
+ {{svg "octicon-fold-up" 16}}
+
+ {{end}}
+ {{if eq $line.GetExpandDirection 2}}
+
+ {{svg "octicon-fold" 16}}
+
+ {{end}}
+ |
+ {{else}}
+ |
+ |
{{end}}
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
-
- {{svg "octicon-fold-up" 16}}
-
+ |
+ {{if eq .GetType 4}}
+ {{$section.GetComputedInlineDiffFor $line}} |
+ {{else}}
+ {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}{{end}}{{$section.GetComputedInlineDiffFor $line}} |
{{end}}
- {{if eq $line.GetExpandDirection 2}}
-
- {{svg "octicon-fold" 16}}
-
- {{end}}
-
- {{else}}
- |
- |
- {{end}}
- |
- {{if eq .GetType 4}}
- {{$section.GetComputedInlineDiffFor $line}} |
- {{else}}
- {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}{{end}}{{$section.GetComputedInlineDiffFor $line}} |
- {{end}}
-
- {{if gt (len $line.Comments) 0}}
- {{$resolved := (index $line.Comments 0).IsResolved}}
- {{$resolveDoer := (index $line.Comments 0).ResolveDoer}}
- {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}}
-
- |
-
+ {{if gt (len $line.Comments) 0}}
+ {{$resolved := (index $line.Comments 0).IsResolved}}
+ {{$resolveDoer := (index $line.Comments 0).ResolveDoer}}
+ {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}}
+
+ |
+
-
+
+
+
+ {{end}}
{{end}}
{{end}}
{{end}}