git-split-diffs icon indicating copy to clipboard operation
git-split-diffs copied to clipboard

Diff line overflow when diff include chinese or japanese or korean

Open gitsang opened this issue 2 years ago • 1 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

gitsang avatar Aug 10 '21 03:08 gitsang

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 avatar Aug 11 '21 05:08 banga

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?

banga avatar Apr 24 '23 12:04 banga

Cool, it fixed now, thx. 👍

gitsang avatar Apr 24 '23 13:04 gitsang