News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

SmartIndent + Whitesmith formatting

Started by nightlight, November 25, 2014, 02:01:26 PM

Previous topic - Next topic

nightlight

I have used C::B 10.5 until upgrading recently to 13.12 (Windows version). It seems that Smart/AutoIndent & Brace Smart Indent do not cooperate any more with Source Formatting, specifically with the Whitesmith format. This is how the sample is supposed to look like:


int Foo(bool isBar)
 {
 if (isBar)
   {
   bar();
   return 1;
   }
 else
   {
   return 0;
   }
 }


In the old CB, as soon as the open brace was typed at indent +2, the closing brace would be appear right below it, with empty line & cursor ready for the block in between.

In the new version, typing the same way, the code ends up looking like this, as if forcing some other source formatting style:

int Foo(bool isBar)
{
 if (isBar)
 {
    bar();
    return 1;
 }
 else
 {
    return 0;
 }
}


I tried various settings on Smart/AutoIndent, Brace SmartIndent  and Source Formatting, but no luck. Has anyone found how to make SmartIndent & braces work for Whitesmith formatting?

nightlight

The problem still persists in CB version 16.01 -- it just won't do Whitesmith source formatting while you type but only if you manually force reformat command of the file. It's unfortunate I "upgraded" from CB 10.5 which formatted in Whitesmith style as you type just fine.

oBFusCATed

I get a reasonable behavior when I disable the smart indent option in the Settings -> Editor -> General.
Can you describe the problem with more details?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]