colinta / SublimeFileDiffs

Show diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes.
Other
510 stars 86 forks source link

SublimeDiff gives unexisting differences #84

Closed brupelo closed 6 years ago

brupelo commented 6 years ago

I'm trying to find out why SublimeDiff is giving me unexisting difference when copying content from a hard-disk file to a Sublime temporal view, please take a look:

showcase

As you can see in the demo, diffing between 2 temporal views will give no differences while if I try to diff between the file vs the temporal view I'll get "unexisting" differences. Why is that? And the most important... how can i fix the behaviour?

I've got installed v2.8.0

colinta commented 6 years ago

Interesting, is this on Windows? My guess: newline characters.

brupelo commented 6 years ago

@colinta Indeed, windows7, here's the file I've used on the above test. Please let me know if you can also reproduce it, it'd be great to narrow this one as diffing between temporal views and files is a very very common feature when regenerating projects/makefiles/... :D

Thanks in advance

brupelo commented 6 years ago

@colinta I think I've discovered what's going on ... if you take a look to the original file, it contains tabs... and for some obscure reason when I paste the content into a new file these tabs are magically converted to spaces... which is the main reason why the plugin will report these differences :(

brupelo commented 6 years ago

@colinta I guess I shouldn't use the below settings anymore:

"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,

:(

brupelo commented 6 years ago

Anyway, it seems this was an issue on my side because of my settings configuration, nothing wrong with the plugin so far.

For more info, here's the docs

colinta commented 6 years ago

Ahh interesting... yeah I'm not sure there's much I could do to try to predict this. I wish the built in diff package had a way to ignore whitespace differences, that's something people have requested in the past. ¯_(ツ)_/¯