From cc40d7db465587de4ecd3ac9824b5148e0cf33e0 Mon Sep 17 00:00:00 2001 From: Ian Moody Date: Thu, 31 Oct 2019 19:36:54 +0000 Subject: [PATCH] Don't put the first line of context in place of funcname in hunk header This makes the diffs in the web UI look weird by appearing to remove one line of context from the start. This also removes an extra inserted space between the +/- line indicator and line contents. Fixes https://todo.sr.ht/~sircmpwn/git.sr.ht/248 --- gitsrht/templates/utils.html | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/gitsrht/templates/utils.html b/gitsrht/templates/utils.html index 9cab9fe..b3484e4 100644 --- a/gitsrht/templates/utils.html +++ b/gitsrht/templates/utils.html @@ -159,9 +159,8 @@ endif %}{% endfor %} target="_blank" {% endif %} >{{hunk.new_start}},{{hunk.new_lines}} {# -#}@@{% if hunk.old_start == 0 %} -{% endif %}{% for line in hunk.lines +#}@@ +{% for line in hunk.lines %}{{line.origin}}{% - if loop.first and hunk.old_start != 0 -%}{{line.content.lstrip()}}{% - else -%} {{line.content}}{% - endif -%}{% endfor %} +>{{line.origin}}{{line.content}}{# +#}{% endfor %} {% endfor %} {% endfor %} -- 2.38.4