On 24.04.2011 02:59, Ryan J Ollos wrote:
> I was converting tabs to whitespace throughout my codebase today and made a
> couple of observations when reviewing changes.
>
> 1. Tabs are shown as having varying length:
>
> Here are two lines from a diff viewed in vim with `:set list` on:
>
> -^I^I^IColorDopplerEstimationType::FromString(^ImxGetPropertyAsString(
> mxaParams, parentName, "EstimationType" ) );$
>
> -^I^I^IColorDopplerDirection::FromString(^ImxGetPropertyAsString(
> mxaParams, parentName, "Direction" ) );$
>
> Here is the view on the lhs of TMerge:
>
> http://old.nabble.com/file/p31463769/TMerge_Line279%2526287.png
> TMerge_Line279%26287.png
>
> Why are the single tab characters displayed as having length 1 and 2 spaces,
> respectively?
Because a tab stops at specific columns. Example:
1
12
123
if you add a tab after the last char in each of the above lines, you
will end up in column 4 (if the tab space is set to four, which it is in
most situations).
So in the first line, the tab would be displayed as three chars wide,
two chars wide in the second line and one char wide in the third line.
> 2. In the previous example, 'Ignore whitespace changes' was selected. I'm
> seeing several cases were the only changes are tab -> whitespace conversions
> and these are displayed as changes in the viewer. However these are
> *usually* ignored when 'Ignore whitespace changes' is selected.
>
> The 'ignore' setting does not have an affect when the tab to whitespace
> changes are not at the beginning of the line. In (1), there are tab to
> whitespace changes in the middle of the line. Here is another example where
> the tab to whitespace changes are at the end of the line.
>
> -^I^Iconst bool axisIsVisibleY = mxGetPropertyAsBool( mxDisplay,
> parentName, "AxisIsVisibleY", i );^I^I $
>
> TMerge lhs:
> http://old.nabble.com/file/p31463769/TMerge_Line429_LHS.png
>
> TMerge rhs:
> http://old.nabble.com/file/p31463769/TMerge_Line429_RHS.png
There are two settings to ignore whitespaces. The "ignore whitespace
changes" will ignore changes at the beginning or end of lines, and
"ignore all whitespace changes" will also ignore them in the middle of
the line.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2723797
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-04-24 08:35:56 CEST