Incorrect highlighted lines of the Files Changed view of a pull request #14697

Closed
opened 2025-11-02 11:20:24 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @typeless on GitHub (Jul 3, 2025).

Description

The downloaded patch:

Image

The Files Changed view:

Image

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.43.0

Operating System

Ubuntu Server 24.04 LTS

How are you running Gitea?

https://docs.gitea.com/installation/install-from-binary
Managed by Systemd.

Database

PostgreSQL

Originally created by @typeless on GitHub (Jul 3, 2025). ### Description The downloaded patch: ![Image](https://github.com/user-attachments/assets/5f6b2b8a-f3df-46ca-881b-928738345966) The Files Changed view: ![Image](https://github.com/user-attachments/assets/a67ec027-a8fd-4ec7-b099-1334ae0983d9) ### Gitea Version 1.24.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.43.0 ### Operating System Ubuntu Server 24.04 LTS ### How are you running Gitea? https://docs.gitea.com/installation/install-from-binary Managed by Systemd. ### Database PostgreSQL
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 11:20:24 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 3, 2025):

Can you share the file or a link to the commit?

@wxiaoguang commented on GitHub (Jul 3, 2025): Can you share the file or a link to the commit?
Author
Owner

@typeless commented on GitHub (Jul 3, 2025):

@wxiaoguang Unfortunately, that is a proprietary project. I cannot share it.

@typeless commented on GitHub (Jul 3, 2025): @wxiaoguang Unfortunately, that is a proprietary project. I cannot share it.
Author
Owner

@wxiaoguang commented on GitHub (Jul 3, 2025):

Or are you able to provide a reproducible sample?

@wxiaoguang commented on GitHub (Jul 3, 2025): Or are you able to provide a reproducible sample?
Author
Owner

@wxiaoguang commented on GitHub (Jul 3, 2025):

Unable to reproduce by the content from your screenshot.

My test results:

Image


Image


Image

@wxiaoguang commented on GitHub (Jul 3, 2025): Unable to reproduce by the content from your screenshot. My test results: <details> ![Image](https://github.com/user-attachments/assets/d3dc1c7f-df85-4f22-a680-7baa709c8b17) ---- ![Image](https://github.com/user-attachments/assets/e69aa7ae-1abb-4f43-8f5a-f0d22f8d713b) ---- ![Image](https://github.com/user-attachments/assets/617f3936-6bea-4f18-a6c6-1252a8f4d93e) </details>
Author
Owner

@typeless commented on GitHub (Jul 3, 2025):

@wxiaoguang I am still unable to figure out how to reproduce it predicatably.

Strangely, it doesn't have the problem when displayed in Conversation.

Image

@typeless commented on GitHub (Jul 3, 2025): @wxiaoguang I am still unable to figure out how to reproduce it predicatably. Strangely, it doesn't have the problem when displayed in Conversation. ![Image](https://github.com/user-attachments/assets/27f74515-bb57-470d-a6d1-d137de35b672)
Author
Owner

@typeless commented on GitHub (Jul 3, 2025):

Adding DISABLE_DIFF_HIGHLIGHT = true to app.ini can workaround the issue.

@typeless commented on GitHub (Jul 3, 2025): Adding `DISABLE_DIFF_HIGHLIGHT = true` to `app.ini` can workaround the issue.
Author
Owner

@wxiaoguang commented on GitHub (Jul 3, 2025):

Is it only reproducible by your "fiscal.c" file? If so and if I can promise that I will keep your proprietary safely, is it possible to email it to me privately? (No worry if it's not suitable to share the proprietary file, that's also fine, I will try other approaches to reproduce and/or fix)

@wxiaoguang commented on GitHub (Jul 3, 2025): Is it only reproducible by your "fiscal.c" file? If so and if I can promise that I will keep your proprietary safely, is it possible to email it to me privately? (No worry if it's not suitable to share the proprietary file, that's also fine, I will try other approaches to reproduce and/or fix)
Author
Owner

@wxiaoguang commented on GitHub (Jul 3, 2025):

The most suspicious PR is this one: Full-file syntax highlighting for diff pages #33766 and a following-up fix: Fix material icon & diff highlight #33844

It rewrote the "highlight diff" logic.

@wxiaoguang commented on GitHub (Jul 3, 2025): The most suspicious PR is this one: Full-file syntax highlighting for diff pages #33766 and a following-up fix: Fix material icon & diff highlight #33844 It rewrote the "highlight diff" logic.
Author
Owner

@typeless commented on GitHub (Jul 4, 2025):

My colleague found the C file containing a suspicious \r, which is probably the culprit.

Image

@typeless commented on GitHub (Jul 4, 2025): My colleague found the C file containing a suspicious `\r`, which is probably the culprit. ![Image](https://github.com/user-attachments/assets/13ba60f1-d9b0-49e8-bd39-5626a803ea2f)
Author
Owner

@GiteaBot commented on GitHub (Aug 3, 2025):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Aug 3, 2025): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14697