banga/git-split-diffs

Diff line overflow when diff include chinese or japanese or korean

gitsang opened this issue ยท 3 comments

image

I think it's because C/J/K letter occupies two bytes.

Is there any way to fix it?

And there are my gitconfigs:

[pager]
    diff = "git-split-diffs --color=16m | less -RFX"
[split-diffs]
    theme-name = dark
banga commented

Yes, same as #11. The main issue is that we need to switch to something that implements grapheme-aware string lengths (https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries). I haven't gotten around to it because it's a fairly involved change, but thanks for the nudge.

banga commented

Hi @gitsang, I just pushed a change to handle wide characters. It should be in the v0.15 release. Can you try it out and let me know if there are any remaining issues?

Cool, it fixed now, thx. ๐Ÿ‘