You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the last line of a file is deleted, the diff rendering incorrectly shows a code-expander-button below that last line, and clicking it incorrectly expands the first lines of the file after that last line.
)
Fixes: #29498
I don't quite understand this code, but this change does seem to fix the
issue and I tested a number of diffs with it and saw no issue. The
function gets such value if last line is an addition:
```
LastLeftIdx: (int) 0,
LastRightIdx: (int) 47,
LeftIdx: (int) 47,
RightIdx: (int) 48,
```
If it's a deletion, it gets:
```
LastLeftIdx: (int) 47,
LastRightIdx: (int) 0,
LeftIdx: (int) 48,
RightIdx: (int) 47,
```
So I think it's correct to make this check respect both left and right
side.
DennisRasey
pushed a commit
to DennisRasey/forgejo
that referenced
this issue
Mar 6, 2024
…501)
Fixes: go-gitea/gitea#29498
I don't quite understand this code, but this change does seem to fix the
issue and I tested a number of diffs with it and saw no issue. The
function gets such value if last line is an addition:
```
LastLeftIdx: (int) 0,
LastRightIdx: (int) 47,
LeftIdx: (int) 47,
RightIdx: (int) 48,
```
If it's a deletion, it gets:
```
LastLeftIdx: (int) 47,
LastRightIdx: (int) 0,
LeftIdx: (int) 48,
RightIdx: (int) 47,
```
So I think it's correct to make this check respect both left and right
side.
(cherry picked from commit 3b99066aa866e51e6a610716eaddfd1ea3645a67)
Description
When the last line of a file is deleted, the diff rendering incorrectly shows a
code-expander-button
below that last line, and clicking it incorrectly expands the first lines of the file after that last line.https://try.gitea.io/silverwind/symlink-test/commit/96ab2118ae7afd916791a00531016d99e11c2009
Incorrectly displayed button:
Incorrect expansion after click:
Works fine if the last line is an addition:
https://try.gitea.io/silverwind/symlink-test/commit/24fb688b579af3c75e0d5cefe1ec4bf721585823
Gitea Version
main
Can you reproduce the bug on the Gitea demo site?
Yes
The text was updated successfully, but these errors were encountered: