sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
272 stars 14 forks source link

Add support for `--word-diff` #1901

Open themilkman opened 2 months ago

themilkman commented 2 months ago

Problem description

git diff --word-diff can be very useful sometimes. I do not see a possibility to gain the following result in SM (at least not that clear visible, as numbers are splitted):

base:

[
    228848 241116 249419 228612 228868 228876 262139 272879 273872 277932
    277872 278227 278192 289282 289293 293868 298889 298897 282422 283723
    283731 283728 284886 284894 286872 286883 288396 288384 288426 288434
    288442 611742 612268 612276 612616 612721 612981 612812 612823 626782
    626812 629228 629978 629883 631872 631882 632682 632693 641298 641299
    641298 641343 641344 641486 641287 641868 642384 642382 642386 642387
    642388 642389 642423 642441 642443 642283 642614 642612 642694 642692
    642746 642747 642829 642828 643174 643172 643176 643177 643179 643183
    643184 643182 643228 643229 643228 643231
  ]

changed content:

[
    228848 229188 229213 241116 249419 249224 228264 228612 228868 228876
    262139 268173 268181 268198 272338 272348 272326 272879 273872 277932
    277872 278227 278179 278187 278192 289282 289293 293868 298889 298897
    282422 283723 283731 283728 284886 284894 284967 284972 284983 286872
    286883 288396 288384 288426 288434 288442 611742 612268 612276 612616
    612721 612981 612812 612823 626782 626812 627282 629228 629978 629883
    631872 631882 632682 632693 641298 641299 641298 641343 641344 641486
    641287 641868 642384 642382 642386 642387 642388 642389 642423 642441
    642443 642283 642614 642612 642694 642692 642746 642747 642829 642828
    643174 643172 643176 643177 643179 643183 643184 643182 643228 643229
    643228 643231
  ]

git diff --word-diff

[
      228848 {+229188 229213+} 241116 249419 {+249224 228264+} 228612 228868 228876
      262139 {+268173 268181 268198 272338 272348 272326+} 272879 273872 277932
      277872 278227 {+278179 278187+} 278192 289282 289293 293868 298889 298897
      282422 283723 283731 283728 284886 284894 {+284967 284972 284983+} 286872
      286883 288396 288384 288426 288434 288442 611742 612268 612276 612616
      612721 612981 612812 612823 626782 626812 {+627282+} 629228 629978 629883
      631872 631882 632682 632693 641298 641299 641298 641343 641344 641486
      641287 641868 642384 642382 642386 642387 642388 642389 642423 642441
      642443 642283 642614 642612 642694 642692 642746 642747 642829 642828
      643174 643172 643176 643177 643179 643183 643184 643182 643228 643229
      643228 643231
    ]

Which shows that there were only additions, ignoring the line breaks

(#918 was the for the same, but closed & without example... hope it's fine to create a new one)

Preferred solution

Maybe an option for inline-diff view? Could be presented in a way like --word-diff=color.

tobiasrenkin commented 2 months ago

That would be really nice!