Compare by content: wrap long lines

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

e_gold
Junior Member
Junior Member
Posts: 2
Joined: 2011-12-14, 10:35 UTC
Location: Tuebingen, Germany

Compare by content: wrap long lines

Post 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.
The software can only get beta ;-)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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
Author of Total Commander
https://www.ghisler.com
e_gold
Junior Member
Junior Member
Posts: 2
Joined: 2011-12-14, 10:35 UTC
Location: Tuebingen, Germany

Post 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.
The software can only get beta ;-)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post 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.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post 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.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
Octagon
Junior Member
Junior Member
Posts: 44
Joined: 2010-06-09, 20:05 UTC

Post 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.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Wrapping lines in CBC would be great.
oshizelly
Junior Member
Junior Member
Posts: 60
Joined: 2013-09-07, 13:51 UTC

Post 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 ;)
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post 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.
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post 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
TW
Senior Member
Senior Member
Posts: 383
Joined: 2005-01-19, 13:35 UTC

Post 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.
licenced and happy TC user since 1994 (#11xx)
Cars10
Junior Member
Junior Member
Posts: 6
Joined: 2014-05-14, 07:57 UTC
Location: Darmstadt, Germany

Post by *Cars10 »

Yes, I have this trouble many, many times as well. This would be a tremendous improvement.
Hammillian7
Junior Member
Junior Member
Posts: 98
Joined: 2003-07-16, 22:40 UTC
Location: Spain

Strong support by myself

Post 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.
Thanks,
Jose

Nubia Redmagic 7Pro with non-rooted Android 13
fgnievinski
Junior Member
Junior Member
Posts: 11
Joined: 2011-11-10, 02:34 UTC

Re: Compare by content: wrap long lines

Post 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.
Post Reply