C++ and other block code diffing upgrade suggestions

Post your new features ideas and suggestions here.
Post Reply
smercer
Posts: 2
Joined: Thu May 04, 2006 8:53 pm

C++ and other block code diffing upgrade suggestions

Post by smercer »

My company (National Instruments) has been using CompareIt for a few years now. It's marvelous. Over time, I've collected some diffing tweaks that would be useful specifically for diffing code files -- C++, Java, or any language that has a block structure.

The first suggestion is that users of CompareIt be able to set begin and end block delimiters. In C++ and Java, the character would be { and }. The diff should give preference to keeping blocks together. Currently if I add a function to the middle of a C++ file, the diff will show the close brace of the previous function down to right before the close brace of my new function as the inserted code.

The second suggestion is that if the only difference is leading whitespace that only the whitespace be highlighted instead of the entire line. That would make it a lot easier to prove during a buddy session that the only change is that I tabbed a block of code in. As it stands I diff it once with all whitespace comapred and again with all whitespace ignored to show what the change was. It's too easy to miss the red/blue text color change if you deleted a character or something by accident.

Last, my team would love it if "Insert Tab" defaulted to "tab" as the shortcut key instead of "ctrl+tab". Everyone has to fix this when we first install on a new hire's machine. ;-)

Generally, a great product!

TonHu
Posts: 100
Joined: Mon Sep 29, 2003 10:48 am
Location: Netherlands

Post by TonHu »

These sound like requests I didn't know how to put in words..... :idea:

Thnx
Ton

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Thank you! In fact using syntax information for comparison is a long-time planned feature, so I hope with time I will be able to implement it (just as displaying current function name when you don't see it on a screen).

As for highlighting, you can try to change colors so that same characters in line are drawn with common same color. This will give you partially effect you need. Also do not miss "Change marks" option - it will be useful for long lines. But your suggestion to use partial highlighting only when there are some minimal changes is good, I will keep it.
As a side note, I'm going to add some predefined color schemes for such setings.

Unfortunately most users seems to use TAB to toggle panes - in first versions TAB works as you describe and there was many messages about it. But you can save your configuration time, if you provide default ini file with all standard settings - user can use it after installing. I think I can also add TAB usage to the installer questions.

Ro Ablate
Posts: 41
Joined: Mon Dec 22, 2003 5:49 pm

Post by Ro Ablate »

I too would very much like to have the option of highlighting the altered leading or trailing whitespaces if that is all that changed on that line.
Excellent idea!

FWIW, I too altered the Tab/Ctrl-Tab use to be like standard windows - and it took me only a day or so to remember to use them like I normally do in my other applications.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Why don't you guys just ignore leading spaces, like I do? :)
Anyway, I like the idea too.
But it will hardly work for trailing spaces - you will not see changes at all at first glance, which is not what you want.

PS. And do not miss "View whitespace" option.

Post Reply