Skip to content

Conversation

@andycandy-dev
Copy link

@andycandy-dev andycandy-dev commented Oct 13, 2025

Magit v4.4.0 Compatibility Fix

Problem

After upgrading to Magit v4.4.0, emacs-pr-review lost:

  1. Syntax highlighting in diff code blocks
  2. Proper fontification of UI elements (titles, mentions, sections, etc.)

Root Cause

Magit v4.4.0 changed from using face text properties to font-lock-face properties for all text rendering in magit-section-mode buffers.

From Magit v4.4.0 changelog:

"All text inserted into Magit buffers that previously used face now use font-lock-face and magit-section-mode can therefore set font-lock-defaults."

fixes #20

ok, I've been fighting my agent for a while now, this seems to legitimately fix fonts on both UI and diff sections.
I've introduced overlays, didn't find a better way to have support for syntax highlighting.
tested with [email protected] and [email protected] on doomemacs.
Screenshot 2025-10-14 at 18 55 02

@andycandy-dev
Copy link
Author

@blahgeek @gavv can you guys review please?

@blahgeek
Copy link
Owner

Thank you so much for submitting the issue and the pull request.

I do agree with you that using overlay to support diff section's highlighting does not seem to be the best option, especially for the "post-command-hook" part. I don't know a better way either.

Also, maybe for the similar reason as the diff section, the faces of the HTML body are still missing. (see below. first image is the result of current PR. second image is the expected result)

Screenshot 2025-10-16 at 22 50 28 Screenshot 2025-10-16 at 23 41 15

I do hope we can find a better solution.

Until then, I've pushed a quick fix d893429 to master that set font-lock-defaults back to nil, which should also fix the issue. Though I'm not sure if it's a good fix in the long run.

@andycandy-dev
Copy link
Author

the faces of the HTML body are still missing.
missed that, yeah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Font and Syntax Highlighting (magit@^4.4.x)

2 participants