Simplify split diff view generation and remove JS dependency (#16775)
Gitea has relied on some slow JS code to match up added and deleted lines on the diff pages. This can cause a considerable slow down on large diff pages. This PR makes a small change meaning that the matching up can occur much more simply. Partial fix #1351 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
d24eb6e6ce
commit
f5b0e2c9d2
4 changed files with 109 additions and 75 deletions
|
@ -83,6 +83,7 @@ func TestGetDiffPreview(t *testing.T) {
|
|||
{
|
||||
LeftIdx: 3,
|
||||
RightIdx: 0,
|
||||
Match: 4,
|
||||
Type: 3,
|
||||
Content: "-Description for repo1",
|
||||
Comments: nil,
|
||||
|
@ -90,6 +91,7 @@ func TestGetDiffPreview(t *testing.T) {
|
|||
{
|
||||
LeftIdx: 0,
|
||||
RightIdx: 3,
|
||||
Match: 3,
|
||||
Type: 2,
|
||||
Content: "+Description for repo1",
|
||||
Comments: nil,
|
||||
|
@ -97,6 +99,7 @@ func TestGetDiffPreview(t *testing.T) {
|
|||
{
|
||||
LeftIdx: 0,
|
||||
RightIdx: 4,
|
||||
Match: -1,
|
||||
Type: 2,
|
||||
Content: "+this is a new line",
|
||||
Comments: nil,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue