pnedev / comparePlus

Compare plugin for Notepad++
GNU General Public License v3.0
1.01k stars 139 forks source link

When comparing two XML files and using Fold buttons, section automatically unfolds if it is only present in one file #346

Closed viliger2 closed 1 year ago

viliger2 commented 1 year ago

As title summarizes, when I compare two XML files, I usually use Fold and Unfold buttons to move entire sections between files. However, ComparePlus, unlike old Compare plugin, automatically unfold the section after I fold it, but only if section is present only in one of the files (marked green or red in default coloring scheme). I would assume it happens with other language markdowns as well that use folding, not just XML.

pnedev commented 1 year ago

This behavior is intentional because of the new way ComparePlus deals with diffs alignment (compared to the old Compare plugin). ComparePlus uses annotations to align diffs and also makes sure diffs are not made invisible due to lines folding. I will check if something might be improved without introducing a lot of side effects and ambiguities but you might consider this for now as an intentional limitation.

shulmanv commented 1 year ago

This might be intentional but it makes Compare+ unusable for comparing large xmls, jsons, and so on... You could assume that whatever is folded should not be diffed at all, or at least ignored when folded. I guess the w/a for now is to revert to using good n' old Compare to use with fairly large json files which cannot be viewed without the folding feature.

Yaron10 commented 1 year ago

@shulmanv

@pnedev has been working hard to improve the "good n' old Compare". The result is numerous bug-fixes and new features.

Myself and many other users are truly grateful and appreciative.

BTW, the "good n' old Compare" is also @pnedev's work.

shulmanv commented 1 year ago

@Yaron10 From your comment I understand you took my comment as disrespectful somehow. AFAIK "good n' old" is not offensive by any means and I'm too grateful to have those plugins to use for myself, and I appreciate the effort by all involved.

My point is merely to stress that it is pretty important feature to be able to fold json/xml while comparing...

Sometimes a cigar is just a cigar :)

Yaron10 commented 1 year ago

@shulmanv,

"good n' old Compare" is indeed very good. Nothing wrong with that phrase.

ComparePlus is the "Montecristo No.4" cigar. :) Knowing the amount of work involved in presenting you with this fine product, I expected some form of appreciation along with the legit comment.

I'm glad you've done that.

pnedev commented 1 year ago

Thank you @Yaron10 , thank you @shulmanv ,

I'll think about adding an option to ignore folded pieces of the compared files.

BR

Yaron10 commented 1 year ago

Thank you Pavel. 👍

pnedev commented 1 year ago

Hello all,

I have made some changes to allow ignoring folded lines and also to allow folding lines after compare. This changes will be available in the next plugin release version but meanwhile you could use the development builds here: 32-bit, 64-bit

Please have in mind two things: 1) This binaries are targeted for Notepad++ versions 8.5.6 (latest to-date) and higher. 2) This changes are not thoroughly tested and might introduce views synchronizations and diffs visiting side effects. Please don't use also the diffs equalization feature (CTRL + left mouse clicks on compare symbols) on folded lines - it will not properly equalize the hidden diff lines.

I am closing this issue now. Please write again here if you still find inconveniences or malfunctions.

BR

Yaron10 commented 1 year ago

Hello Pavel,

I hope you're doing well.

Thank you for this new feature.

And many special thanks for the major refactoring in the "change detection algorithm". I can only imagine the hard work, and I highly appreciate it. 👍

Seeing that it's still (WIP) - I'd rather not divert/distract you at this stage, and I'll test "fold/unfold" once the WIC.

Best of luck with that work. I'm looking forward to the final result.

pnedev commented 1 year ago

Hello Yaron,

And thank you for the kind words. I sincerely hope you are doing well too.

BR