Closed Snabel42 closed 2 years ago
In your compare case spaces are considered as part of the compared line, in other words - they are considered as normal, meaningful characters. ComparePlus marks a line as changed if a minimum portion of the line is matching (is the same). If a big portion of the line differs then it decides that the line is totally modified and marks it as added or removed. So in your case lines that have small amount of real alphabet characters will not be marked as changed because the modified spaces 'out-weight' them.
To change that you have two options: 1) From the menu select 'Ignore Spaces' and re-compare. Then the changes in spaces will be disregarded as insignificant and you'll probably get a matching files (only real alphabet character differences will be shown, if any). 2) Open ComparePlus settings from its menu and in the bottom of the colors section decrease the 'Min line resemblance...' percentage to 15 or 10. Save and re-compare. This way you configure what is the min. percentage ratio between matching line portion and its total length to decide the line is changed and not completely new (added or deleted).
Thank you for the feedback, very clarigying. This was roughly what I thought, but I wanted to ask for the clarification anyhow.
I suppose I wanted to see if there was a way to treat whitespace (or any other defined char perhaps?) as a 'special case'. From what I wanted to achieve, one whitespace character is as good as any other.
When comparing, the same amount of whitespace should still be there. As an example, three leading spaces can be replaced by three leading tabs, but not four tabs etc. Anything other than a one-to-one replacement of one whitespace character to another should be considered and anomaly and I would like it flagged.
Considering above:
So I fully understand why it works the way it does. If this seems like a useful scenario, I suppose it can be considered a potential feature request?
Hi @vegardheimdal ,
I suppose I wanted to see if there was a way to treat whitespace (or any other defined char perhaps?) as a 'special case'.
It is currently not possible.
If this seems like a useful scenario, I suppose it can be considered a potential feature request?
It seems to me to be a very particular use-case (maybe applicable to Python, IDK) so I don't think its worth the effort implementing it, sorry. You can probably use Regex Ignore to filter-out a predefined number of white spaces and that way you'll see where there are more of them added but that works only if you know how much of them should be present and that is for the whole file. For example if you add regex that ignores any kind of singe white space char in the beginning of the line you'll get diff only if there are more than one different ones.
BR
I used the XML Tools plugin to Pretty Print an XML file. The indenting is changed from using periods to tabs.
All lines were flagged as being changed, which I think is intended with the current setting But a handful of lines which had more leading periods than the others were flagged as removed/new
Is this intended behavior, or can the amount of whitespace that is considered 'changed' be configured somehow?