dragnucs,

Most diff tools have an option to ignore leading or trailing whitespace changes.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

I think OP meant moving a code block up or down in a file, not left or right

PeriodicallyPedantic,

Yes, thank you. I probably should have been more clear

bleistift2,

I’m surprised that after almost 20 years of versioning C code, git still manages to assign the closing brace of a function wrongly.

sim642,

Because text is text and all } are the same.

Kbin_space_program,

laughs in IntelliJ

mormegil,
@mormegil@programming.dev avatar
dill,
@dill@lemmy.one avatar

That logo tho. oh noooooo

flux,

It doesn’t actually detect moved code, though, like git diff can? I gave it a shot and also there’s a couple issues open about it, e.g. github.com/Wilfred/difftastic/issues/520 .

Other than that, difftastic is quite nice.

Blackbird,

Beyond Compare is awesome and handles this and many other things quite well.

MJBrune,

Perforce diff works better than this. Even my basic Git/Gitlab diffs don’t do this.

dream_weasel,

Maybe specify a different diff algorithm? Histogram for example?

saigot,

Me adding one if statement around around a code block. Ah shit I guess I own the whole function now.

Rednax,

At least a good diff tool will ignore whitespace diffs.

sim642,

How do you expect it to be shown though?

PeriodicallyPedantic,

For example, on side by side views, you can draw a box around it on both sides, and draw a line connecting the two

Scrollone,

I think Sublime Merge does this with the conflict resolution tool

csm10495,
@csm10495@sh.itjust.works avatar

Give me some love for adding an indent level either showing nothing changed or you rewrote everything too.

tastysnacks,

If you’re going to rearrange code, have that as a separate check in from changing code.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines