Page 1 of 3
Compare by contents: Word wrap
Posted: 2007-06-21, 06:58 UTC
by Alextp
Suggested at forum.wincmd.ru
Would be nice if CBC window will allow to change the Word Wrap mode on/off.
Posted: 2007-06-21, 07:55 UTC
by jjk
Support ++
JJK
Posted: 2007-06-21, 12:25 UTC
by MacQ
Hear hear!
Posted: 2007-06-21, 14:27 UTC
by ghisler(Author)
The problem is that the wrapped lines would not be in sync between left and right side. Immagine a 100 word paragraph wrapped to several lines. The left and right lines would quickly get out of sync if one side contains additional words at the beginning of that paragraph...
Posted: 2007-06-21, 15:14 UTC
by Alextp
..
Posted: 2007-06-21, 16:05 UTC
by MacQ
Yes, that's true, but the differences would still be highlighted. The comparing process can still be made in single line, but the wrap could be just visual, e.g. wouldn't change nothing or trigger another compare.
Word wrap would be useful so you don't have to slide for 3 or more screens. It becomes very confusing sometimes as you have to go back and check if you missed something.
The comparission would be made without the wrap, but an option to just turn the wrap on for just this comparission, which would be gone when you close the window, would be great.
Please try to do it and we can test it then.
Who doesn't like it, wouldn't use it.
Posted: 2007-06-21, 16:07 UTC
by Flint
ghisler(Author)
Other programs can handle this. For example, Compare It! just shows empty space (filled with crossed lines) where line from one side is shorter than the corresponding line from another side.
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.