Author Topic: AutoIndent / SmartIndent  (Read 5110 times)

Offline surfinbird

  • Single posting newcomer
  • *
  • Posts: 8
AutoIndent / SmartIndent
« on: October 13, 2007, 10:57:49 pm »
The AutoIndent and/or SmartIndent behaves not as expected when using a code style similar like this:

namespace x
....{
....void func( void )
........{
........if ( test )
............{
............// action
............}
........}
....}

I have checked the "Indent brackets" option in the Source formatter and would expect it to make the difference, but
the AutoIndent and/or SmartIndent generates this:

namespace x
{
....void func( void )
....{
........if ( test )
........{
............// action
........}
....}
}

Is this because the bracket rule doesn't influence a brace, and hence a brace indent option would be needed to make the auto indent working?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: AutoIndent / SmartIndent
« Reply #1 on: October 15, 2007, 09:24:10 am »
The source formatter has nothing to do with the auto indent function. One is a plugin, the other is an editor functionality.
I am not sure if that can be configured differently (never bothered, because I'm fine with ANSI style), but possibly it can... must look in the wxScintilla docu for that. If that is the case, you should be able to change that behaviour by modifying one line of code.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline surfinbird

  • Single posting newcomer
  • *
  • Posts: 8
Re: AutoIndent / SmartIndent
« Reply #2 on: October 15, 2007, 07:03:49 pm »
The source formatter has nothing to do with the auto indent function. One is a plugin, the other is an editor functionality.
I am not sure if that can be configured differently (never bothered, because I'm fine with ANSI style), but possibly it can... must look in the wxScintilla docu for that. If that is the case, you should be able to change that behaviour by modifying one line of code.
I'm not (yet) familiar with the source code of Code::Blocks, any help in that direction would be welcome

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: AutoIndent / SmartIndent
« Reply #3 on: January 29, 2008, 02:37:41 pm »
You'll have to look into cbeditor.cpp around lines 2450 and 2488. Remember to put on your peril-sensitive sunglasses.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."