banga / git-split-diffs

Syntax highlighted side-by-side diffs in your terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong layout for wide characters such as Chinese

ouuan opened this issue · comments

  1. Create a test file with this content:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    
    今撮储哇费民浙,洪诫毫伊逻幸番舶祁胳看钉梁钩贮慨洞芽白穗阐示械渔炎涌滤衅芽鳄些浪出辣膛蒲惠败卧虱腥着假委扭岘枚贷明垃肚屋甩赵曹鳍列腑旗泄踏梭浇贼琼鞍壕句?狠闸款荧运缚渍穆。竿煤秆秋假拦绑;皿触荒江驶釉禹糊滩胸又塘巍睛。砚玻请口岩丙锋金菱邓礁必优俞宰曝烂。枚毫街?型壁蚊碳旗同筹姐扇次案。泳蠕,阮顷浆滚痹削孜焦弦弧参珩虱植蔡第扫亚?
    
  2. Use git-split-diffs to show the diff:

    screenshot

Yes sorry this is on my todo list. I need to switch to using an implementation of https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries to measure line lengths. Thanks for the test case!

FYI : Same problem with Japanese characters.

Hi @ouuan @Neos21, 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?

It works for me. Thanks for the fix!