aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/diff.tmpl
diff options
context:
space:
mode:
authorAlexey Makhov <makhov.alex@gmail.com>2015-02-03 23:53:34 +0300
committerAlexey Makhov <makhov.alex@gmail.com>2015-02-04 12:41:35 +0300
commit7f71fe9dae05d11c51ee5009580c14c47edf5043 (patch)
treeae4083d84637f8861069c61c61f402e5f1634941 /templates/repo/diff.tmpl
parent5589445557b512e5f8f6b2930ab0f15dcf624bfb (diff)
downloadgitea-7f71fe9dae05d11c51ee5009580c14c47edf5043.tar.gz
gitea-7f71fe9dae05d11c51ee5009580c14c47edf5043.zip
fix diff lines highlighting
Diffstat (limited to 'templates/repo/diff.tmpl')
-rw-r--r--templates/repo/diff.tmpl10
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 8045351600..8becb00659 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -102,17 +102,17 @@
<table>
<tbody>
{{range .Sections}}
- {{range .Lines}}
- <tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
+ {{range $i, $line := .Lines}}
+ <tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$i}} ol-{{$i}}">
<td class="lines-num lines-num-old">
- <span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
+ <span rel="L{{$i}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
- <span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
+ <span rel="L{{$i}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
- <pre>{{.Content}}</pre>
+ <pre>{{$line.Content}}</pre>
</td>
</tr>
{{end}}