I don't know what triggers the effect, but sometimes, if I select "ignore white space" and "word wrap", two lines who differs only in blank space are wrapped differently and then higlighted as different.
For example, try with the attached files.
The difference is made by EDP!
The difference is made by EDP!
- Attachments
-
- Wrap.zip
- (457 Bytes) Downloaded 805 times
-
- Expert Member
- Posts: 114
- Joined: Sun May 02, 2010 12:00 pm
- Location: Edinburgh
Re: The difference is made by EDP!
One of your test files has spaces and tabs in it and the other just has spaces for indenting.
It seems to me that EDP could either remove the tabs and excess spaces, then wrap the lines OR expand the tabs to some number of spaces, wrap the lines, and then ignore multiple spaces. I'd guess that which non-blank words end up on which lines due to wrap might not be the same in that case.
It seems to me that EDP could either remove the tabs and excess spaces, then wrap the lines OR expand the tabs to some number of spaces, wrap the lines, and then ignore multiple spaces. I'd guess that which non-blank words end up on which lines due to wrap might not be the same in that case.
Re: The difference is made by EDP!
I'll have a look at this next week. Holidays...
psguru
PrestoSoft
PrestoSoft
Re: The difference is made by EDP!
I think I can survive...

Happy holidays!
Good observation, Jeremy.
I assumed I already saved the files with "expand tabs" so I forgot to check.
Thanks.
Re: The difference is made by EDP!
It's one of those situations, which seems easy to fix but... No matter how tabs are expanded, the result may not be what one expects. In this case you have, it appears, 8-size tabs but what EDP would use depends on its options. If the number is different, wrapping will still look bad. This is the nature of the Synchronized Wrap algorithm in EDP, which tries to align strings based on the first pass of comparison, before wrapping them and comparing again.
BTW, if you try the Simple Wrap option (that is, wrap and compare), the results will be much nicer in your scenario.
BTW, if you try the Simple Wrap option (that is, wrap and compare), the results will be much nicer in your scenario.
psguru
PrestoSoft
PrestoSoft
Re: The difference is made by EDP!
Well, I didn't think a lot about it, but it looked far from simple to me.psguru wrote: Thu Dec 09, 2021 11:01 am It's one of those situations, which seems easy to fix but...
Maybe with an option to collapse the blank space (i.e. every sequence of spaces and/or tabs is collapsed to a single space)?
I think I saw something like that in a program. But, of course, it does a mess with the code indentation...
I completely overlooked this option. Probably I'll find it useful, soon or later.psguru wrote: Thu Dec 09, 2021 11:01 am BTW, if you try the Simple Wrap option (that is, wrap and compare), the results will be much nicer in your scenario.
Re: The difference is made by EDP!
We are more than likely are just going to leave it as is.
psguru
PrestoSoft
PrestoSoft
-
- Expert Member
- Posts: 114
- Joined: Sun May 02, 2010 12:00 pm
- Location: Edinburgh
Re: The difference is made by EDP!
As a programmer, I find the idea of wrapping lines of code quite strange. Perhaps that's because most of my professional programming was done in languages whose origins were in 80-column cards, then 80-column terminal windows, though. Even now with much wider text editor windows I simply wouldn't try to write a line of code that's so long that it needs to wrap. That's not to say that I don't use line continuation, but I choose what goes onMSpagni wrote: Thu Dec 09, 2021 12:21 pm Maybe with an option to collapse the blank space (i.e. every sequence of spaces and/or tabs is collapsed to a single space)?
I think I saw something like that in a program. But, of course, it does a mess with the code indentation...
the first/second/third line when I do that. I also wouldn't heavily indent code - I mean, if something needs more than four or five indents it suggests to me that a different program structure might be better for that part.
I would have thought that if you turned wrap off, then "ignore white space" would in essence collapse sequence of spaces.
Re: The difference is made by EDP!
Exactly so do I. But not some others.JeremyNicoll wrote: Sat Dec 11, 2021 3:02 am As a programmer, I find the idea of wrapping lines of code quite strange. Perhaps that's because most of my professional programming was done in languages whose origins were in 80-column cards, then 80-column terminal windows, though. Even now with much wider text editor windows I simply wouldn't try to write a line of code that's so long that it needs to wrap. That's not to say that I don't use line continuation, but I choose what goes on
the first/second/third line when I do that. I also wouldn't heavily indent code - I mean, if something needs more than four or five indents it suggests to me that a different program structure might be better for that part.

I hate when I have to scroll two or three screens to the right to look what's happening in that line of code.
It's too easy to overlook something.
After all, there must be a reason if, even after centuries, the newspapers still write in columns!

Usually, in those cases I use AStyle (http://astyle.sourceforge.net/) as a plugin to "reconcile" the style as much as possible, then I use almost all the "ignores" of EDP.
But AStyle doesn't handle all the languages I need... let alone when it's a simple text flow, not code.
Well, I can easily do a "space collapser" plugin, after all.
Not a new idea: I altready though about it sometime ago, but then I let it fall in the "forgot bin".
Something to do during the long winter evenings, beside the fireplace...
