Ignore line breaks
Ignore line breaks
Hi, the only topic I found searching about this was about 10 years old so perhaps something has changed since then...
I am comparing HTML files, but they often contain sections of text that render as paragraphs on the page. Our code beautifier adds hard line breaks after 120 characters, which yeah isn't great, we are working on that
The problem is, when we make textual changes, the hard breaks are changed. So for example we go from this:
This text is on line 1,
and this is on line 2,
and this is on line 3.
to this:
This text is on line 1,
and this is now
on line 2, and this is on line 3.
What I want is for that to only highlight one difference, the addition of the word 'now'. Is there a way to have that happen? At the very least, the word 'now' should be highlighted with a different color than the rest of the text that changed, but its not, and therefore difficult to spot. Thanks for any help.
I am comparing HTML files, but they often contain sections of text that render as paragraphs on the page. Our code beautifier adds hard line breaks after 120 characters, which yeah isn't great, we are working on that
The problem is, when we make textual changes, the hard breaks are changed. So for example we go from this:
This text is on line 1,
and this is on line 2,
and this is on line 3.
to this:
This text is on line 1,
and this is now
on line 2, and this is on line 3.
What I want is for that to only highlight one difference, the addition of the word 'now'. Is there a way to have that happen? At the very least, the word 'now' should be highlighted with a different color than the rest of the text that changed, but its not, and therefore difficult to spot. Thanks for any help.
Re: Ignore line breaks
No, there's no way for this to happen.What I want is for that to only highlight one difference, the addition of the word 'now'. Is there a way to have that happen?
Please attach a screenshot of your results.At the very least, the word 'now' should be highlighted with a different color than the rest of the text that changed, but its not, and therefore difficult to spot.
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
Unfortunately I cannot figure out how to attach an image. I found where I could link to an image, but I don't know where I could store an image to link to.
But, whether I add some text or remove some text to this paragraph I am playing around with, all the lines that were affected are colored yellow on both sides, then the words that were affected are colored blue on the left and red/maroonish on the right. The text that was removed or added is also highlighted on the side that it exists, but with the same color as the words that were moved to a new line, making it difficult to notice that they are new (or have been removed), and not just moved around.
But, whether I add some text or remove some text to this paragraph I am playing around with, all the lines that were affected are colored yellow on both sides, then the words that were affected are colored blue on the left and red/maroonish on the right. The text that was removed or added is also highlighted on the side that it exists, but with the same color as the words that were moved to a new line, making it difficult to notice that they are new (or have been removed), and not just moved around.
Re: Ignore line breaks
See https://www.phpbb.com/community/viewtopic.php?t=2499861 on how to attach an image to a post.
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
.. and not to hijack my own thread, but one more question if I may:
Is there a way to make it so that the down and up arrows that move to the various changes, move you relative to your current cursor position in the code? So if I click in the view window, and am scrolling around, and I click in an area where there are no changes, I would like the down arrow to move to the next change after the cursor position, rather than whatever is next in the Diff dropdown list at the top.
We often need to scroll around to make sure we are in the correct spot in the code, but then quickly go back to the change we were looking at. The way it works now is we sometimes have to click up then down again to get back to where we were, making it easier to lose our place.
Is there a way to make it so that the down and up arrows that move to the various changes, move you relative to your current cursor position in the code? So if I click in the view window, and am scrolling around, and I click in an area where there are no changes, I would like the down arrow to move to the next change after the cursor position, rather than whatever is next in the Diff dropdown list at the top.
We often need to scroll around to make sure we are in the correct spot in the code, but then quickly go back to the change we were looking at. The way it works now is we sometimes have to click up then down again to get back to where we were, making it easier to lose our place.
Re: Ignore line breaks
Ahh ok found it thanks. Here is a screenshot then of what I mean. You can see the text I removed is highlighted the same as all the other text (on the left side) that got moved.
And I realize in this particular example it is somewhat simple to see what happened. But, its not always that clear. And if you didnt know what edit was made, it would take a few moments to read through the text to see anyway.
Last edited by mshumway on Thu Jun 24, 2021 8:02 am, edited 1 time in total.
Re: Ignore line breaks
The current diff marker follows your cursor position. You can click in a text pane, then scroll text normally. To go to the next diff block from there you can use the Next Diff command, of Shift-Mouse Wheel scroll.
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
So, I have two changes. If I am viewing the second change, and I click above it in the window, then scroll up a bit, the down arrow should move me back to that change. Currently, its not even available to click in that situation. It is greyed out. I have to click the up arrow, moving me back to the first change, then the down arrow is active again and I can click it to move back to the second change.
Re: Ignore line breaks
And regarding the screenshot, what I would hope is that the text that got deleted "'loan or a Loan Guaranty", be highlighted with a different color, indicating a deletion as opposed to simply having been moved to a new line. But it does sound like that is not possible.
Re: Ignore line breaks
As I said, the current diff marker follows your cursor position. If it's closer to the first change, the latter becomes the current diff.So, I have two changes. If I am viewing the second change, and I click above it in the window, then scroll up a bit, the down arrow should move me back to that change. Currently, its not even available to click in that situation. It is greyed out. I have to click the up arrow, moving me back to the first change, then the down arrow is active again and I can click it to move back to the second change.
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
It is marked as deleted, as far as I can see. You only have two types of inline changes in your sample: deletions (on the left) and additions (on the right).text that got deleted "'loan or a Loan Guaranty", be highlighted with a different color, indicating a deletion as opposed to simply having been moved to a new line.
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
Well, yes, but I would like it to differentiate between text that got moved to a new line, versus text that isn't there anymore. It sees those two types of changes as the same, which makes sense, I just don't like it.
Our current diff program DOES do that, so I know it's possible, it's just that our current diff program also doesn't have word wrap, which is what we are wanting.
Right, and I dont want that either. I want it to always move to the next change relative to the cursor position, not relative to any other change. Sounds like that is not possible either though.
In any case, I appreciate your help!
Re: Ignore line breaks
... and it already does this. Whatever the closest diff block is to the cursor position, EDP will make it the current diff.I want it to always move to the next change relative to the cursor position
psguru
PrestoSoft
PrestoSoft
Re: Ignore line breaks
Ok so I just realized that, while the arrows wont go back to it in this situation, you can click the square yellow button in the middle to get back to the current one. I think that may mostly solve the issue I was having.
Last edited by mshumway on Thu Jun 24, 2021 9:33 am, edited 3 times in total.