Quite often I compare some source code file with an earlier version of it, and sometimes it happens that I wrapped some block of code into if/while or, conversely, moved it outside. As a consequence, indentation of such block changes. Unfortunately, Compare It! completely fails to work with such changes and shows the two versions of the block (original and indented) as two absolutely irrelated blocks, like the first is removed, and the second is inserted. Even manual match is not of much help, because it lasts for several lines only, so I have to set numerous manual matches through all the block just to align this pair and see the real differences. So, my suggestion is: adapt the comparison and matching algorithm so that it took into account possible indentations of text blocks and could align them properly.
Of course I know that I can make CI ignore leading blanks. But if I do that, CI completely ignores them, and that's not what I need. I want to know that something has changed in this particular block of code, even if the chage was in indentation only. So now there are only two options currently: either not see the indentation changes at all, or see the indented block as a completely different block of code and be unable to compare it with the previous version (except for the tedious several manual match sets). I'd like to have possibility to have the indented block aligned with its non-indented version without concealing that the indentation took place at all.
Better autodetect for indentation changes
-
- Posts: 8
- Joined: Mon Sep 25, 2006 5:38 pm
- Location: Moscow, Russia
- Contact:
Re: Better autodetect for indentation changes
Well, this does make sense for moved block detection, I will add this to to-do list. Thank you!
Re: Better autodetect for indentation changes
I think this would be very helpful, happened to me a few times too.