Wilfred / difftastic

a structural diff that understands syntax 🟥🟩
https://difftastic.wilfred.me.uk/
MIT License
21.14k stars 346 forks source link

Verbose unicode expansion of Lean code #768

Closed Seppel3210 closed 1 month ago

Seppel3210 commented 1 month ago

When writing Lean, which heavily uses unicode, my git diffs with difftastic look like this: image

Whereas, e.g., delta looks like this: image

Is there any way to tell difft to not escape unicode?

Wilfred commented 1 month ago

Could you share a sample file?

Seppel3210 commented 1 month ago

You should get a similar diff between this commit https://github.com/Seppel3210/batteries/commit/e3ffef5301b0c391097368dc3b4d372934381418 and its parent

Seppel3210 commented 1 month ago

I guess a file that's a bit smaller would be this https://github.com/Seppel3210/batteries/blob/main/Batteries/Data/Fin/Lemmas.lean

Wilfred commented 1 month ago

I can't reproduce I'm afraid:

Screenshot from 2024-09-29 14-51-21

Could you confirm your difftastic version, your operating system, and your terminal emulator?

Seppel3210 commented 1 month ago

FYI I'm on a trip without my laptop, so I'll take a couple days to respond

Seppel3210 commented 1 month ago

turns out it was an issue with the git pager (less) escaping unicode. Fixed by setting the env var LESSCHARSET=utf-8.

Seppel3210 commented 1 month ago

this wasn't an issue with delta, as it uses itself as the pager