]> source.dussan.org Git - gitea.git/commit
Fix wrong line number in code search result (#29260) (#29623)
authorGiteabot <teabot@gitea.io>
Wed, 6 Mar 2024 09:05:41 +0000 (17:05 +0800)
committerGitHub <noreply@github.com>
Wed, 6 Mar 2024 09:05:41 +0000 (10:05 +0100)
commit9db426ad8c7122633fa3e31a427fd1e65ddad334
tree2616a12717fdc44d1cbbe7ebf0e99a5f3f741f35
parenta8277cfc8fd6263ce935d14bcbff183c4ecf116d
Fix wrong line number in code search result (#29260) (#29623)

Backport #29260 by @yp05327

Fix #29136

Before:
The result is a table and all line numbers are all in one row.

![image](https://github.com/go-gitea/gitea/assets/18380374/7a18b354-e257-4f57-a5ca-f6d37378edf6)

![image](https://github.com/go-gitea/gitea/assets/18380374/98416e11-89b5-4b4f-920b-91bcf041a87f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f189e436-9046-4431-926a-cd0deb58e8f1)

![image](https://github.com/go-gitea/gitea/assets/18380374/07d213ed-2401-4b7f-b951-5df7dc776af4)

~~Updated:~~
~~added `active` class to the target line.~~

![image](https://github.com/go-gitea/gitea/assets/18380374/0b274e48-048a-4c66-ba95-df515212ec08)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
modules/indexer/code/search.go
templates/code/searchresults.tmpl
templates/repo/search.tmpl
templates/shared/searchfile.tmpl [new file with mode: 0644]