mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-23 02:50:26 +08:00
3b99066aa8
Fixes: https://github.com/go-gitea/gitea/issues/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. |
||
---|---|---|
.. | ||
testdata/academic-module | ||
csv_test.go | ||
csv.go | ||
gitdiff_test.go | ||
gitdiff.go | ||
highlightdiff_test.go | ||
highlightdiff.go | ||
main_test.go |