~edwargix/git.sr.ht

cc40d7db465587de4ecd3ac9824b5148e0cf33e0 — Ian Moody 6 years ago 8b51f1b
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
1 files changed, 4 insertions(+), 10 deletions(-)

M gitsrht/templates/utils.html
M gitsrht/templates/utils.html => gitsrht/templates/utils.html +4 -10
@@ 159,9 159,8 @@ endif %}{% endfor %}
  target="_blank"
  {% endif %}
>{{hunk.new_start}}</a>,{{hunk.new_lines}} {#
#}@@</strong
>{% if hunk.old_start == 0 %}
{% endif %}{% for line in hunk.lines
#}@@</strong>
{% for line in hunk.lines
%}<span class="{{({
  "+":"text-success",
  "-":"text-danger",


@@ 169,13 168,8 @@ endif %}{% endfor %}
    href="#{{anchor}}{{patch.delta.old_file.path}}-{{hunk_index}}-{{loop.index}}"
    id="{{anchor}}{{patch.delta.old_file.path}}-{{hunk_index}}-{{loop.index}}"
    style="color: inherit"
>{{line.origin}}</a>{%
  if loop.first and hunk.old_start != 0
%}{{line.content.lstrip()}}{%
  else
%} {{line.content}}{%
  endif
%}</span>{% endfor %}
>{{line.origin}}</a>{{line.content}}{#
#}</span>{% endfor %}
{% endfor %}</pre>
</div>
{% endfor %}