Detecting tabs vs. spaces is easy, however, detecting 2-space indentation vs 4-space indentation (or any other arbitrary number of spaces) is a little more difficult.
I plan to create a threshold to determine the indentation style (and fall back to defaults if it is indeterminate). To tune this to greater accuracy, I need to collect statistics on samples of multiple styles of code.
If anyone could post samples/links to different styles of code, I can run this test on them.
If you have time to test yourself, apply the attached patch, and post the numbers printed in the Code::Blocks log (along with what the indentation style of the file(s) actually is).