mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-04 10:30:19 -05:00
3b2f28ff1c
Port [Fix wrong line number in code search result (gitea#29260)](https://github.com/go-gitea/gitea/pull/29260) PS: also added [`-e`](https://git-scm.com/docs/git-grep#Documentation/git-grep.txt--e) before passing the keyword (my bad) Co-authored-by: yp05327 <576951401@qq.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2619 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com> Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
14 lines
494 B
Go HTML Template
14 lines
494 B
Go HTML Template
<div class="file-body file-code code-view">
|
|
<table>
|
|
<tbody>
|
|
{{range .SearchResult.Lines}}
|
|
<tr>
|
|
<td class="lines-num">
|
|
<a href="{{$.RepoLink}}/src/{{if not $.IsIndexer}}branch{{else}}commit{{end}}/{{PathEscape $.SearchResult.CommitID}}/{{PathEscapeSegments $.SearchResult.Filename}}#L{{.Num}}"><span>{{.Num}}</span></a>
|
|
</td>
|
|
<td class="lines-code chroma"><code class="code-inner">{{.FormattedContent}}</code></td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|