Page 1 of 2

Compare by content: wrap long lines

Posted: 2011-12-14, 11:27 UTC
by e_gold
The present version of "File|Compare by content" is not very useful if one needs to compare text files with very long lines. I very often write text files (actually TeX files) where the whole paragraph is actually a long single line. My editor just wraps it as I reach the end of the window NOT INSERTING HARD BREAKS (new line character(s)) into file itself. This is very useful because if I edit the text, it will be wrapped automatically (I do not need to care about (re)formatting/deleting/reinserting line breaks).

If I try to compare two versions of such files using "File|Compare by content", TC shows which lines are different, but the differences are not visible as they are far away behind the right edge of left and right window.

Suggestions 1: can TC word wrap long lines when it shows them in comparison window? Corresponding check box would be great!

Suggestions 2: Can TC treat new-line character like space? More exactly, one new_line=space, more then one new+line = new paragraph.

Posted: 2011-12-14, 15:24 UTC
by ghisler(Author)
The compare tool in TC is line-based. It couldn't handle very long lines well even if it did word wrapping. The comparison calculates a checksum (hash) for each line, and then compares the hashes. With long paragraphs, the chance would be high that there would be no (or very few) line matches between the two files.

Maybe a different compare tool can do what you need? Try e.g. "beyond compare" or "Winmerge". You can define a compare tool in wincmd.ini with the line
CompareTool=c:\path\toolname.exe

Posted: 2011-12-14, 16:21 UTC
by e_gold
Christian,

They both do not provide word wrap either. But listen, what is needed is pretty simple: it does not affect the way how comparison is done! It only affects the way how the text is SHOWN after comparison. So instead of

Code: Select all

| 100: blah                          | 100: blah                          |
| 101: text text text text text text | 101: text text text text text text |
| 102: blah                          | 102: blah                          |
with no visible differences in line 101 ('|' represents the window boundary and the text is actually much longer than the window width) I would like to have the following representation

Code: Select all

| 100: blah                          | 100: blah                          |
| 101: text text text text text text | 101: text text text text text text |
|      text NEW RED TEXT text text   |      text text text text text text |
|      text text text                |                                    |
| 102: blah                          | 102: blah                          |
Is it possible to implement?

The number of corrections is usually small, so NOT every long line (paragraph) is different.

Posted: 2011-12-14, 16:36 UTC
by MVV
I agree that it would be better to split long lines in compare panels. Sometimes it is too hard to see little difference if line is too long.

Posted: 2011-12-14, 23:14 UTC
by petermad
What e_gold suggests seems like a nice feature to have.

Until then I use Lucida Console size 7 in the CbC tool - it is just readable and shows a lot of text.

Posted: 2011-12-15, 14:13 UTC
by Flint
e_gold wrote:They both do not provide word wrap either.
WinMerge definitely does.

However, if CbC supported word wrapping it would be really nice.

Posted: 2012-01-07, 18:41 UTC
by Octagon
ghisler(Author) wrote:The compare tool in TC is line-based.
Not exactly. There is a binary comparison option. I wonder why nobody proposed that, since I do not see, even theoretically, any better way out for the original problem.

I do not know if the "Ignore repeated spaces" and "Case sensitive" options work in the binary mode, but I guess they should.

Replacing "Ignore repeated spaces" with "Ignore repeated whitespace" and specifying what exactly is whitespace, including EOL symbols, may be very handy in special cases.

Posted: 2014-03-22, 03:33 UTC
by MarcinW
Wrapping lines in CBC would be great.

Posted: 2014-04-25, 13:59 UTC
by oshizelly
Wrapping lines as and option in Compare by content window may be simply useful for binary files. But this feature is absolutely necessary to compare text files. Have anybody any ideas, for what reason Christian does does not like the idea of adding this option to save those users, who needs it?
This argument ( http://www.ghisler.ch/board/viewtopic.php?p=237222&sid=d2f6be429af5fc95925cda6ba4c003b0#237222 )does not seem to be very convenient for me, is there are any hidden considerations ;)

Posted: 2014-04-27, 14:57 UTC
by HBB
I support this suggestion too.

Due to the reasons of Author, instead of expanding all lines, at least, a double-click action which expands/collapse the line under the cursor may help.

Posted: 2014-05-04, 01:07 UTC
by billiebub
definitely support this feature. It gets rather frustrating when having to scroll horizontally trying to find the changed characters. Even more frustrating when the lines are very very long

Posted: 2014-05-04, 21:26 UTC
by TW
support from me too.

just try to compare firefox' addons.js for example. it's all in one line... it's almost impossible to find the differences using cbc.

Posted: 2014-05-14, 08:01 UTC
by Cars10
Yes, I have this trouble many, many times as well. This would be a tremendous improvement.

Strong support by myself

Posted: 2014-06-19, 13:58 UTC
by Hammillian7
I also strongly vote for this option: showing long lines as wrapped would solve the problem that I suffer daily when comparing my C files.

Re: Compare by content: wrap long lines

Posted: 2019-07-27, 23:15 UTC
by fgnievinski
the request is simply to make the horizontal scrollbar optional instead of being mandatory.
that way, the user can adjust the textbox width simply resizing the entire window.