News:

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

Main Menu

Function Auto-Indent

Started by Volatile Pulse, October 16, 2012, 08:38:59 AM

Previous topic - Next topic

Volatile Pulse

I searched around on the forums this time and even look through a few seemingly relevant posts to no avail. I am a fan of attached braces for functions and control statements. Now, I'm not positive, but I believe what I want falls under the Auto-Indent title, and I hope this is the right forum, forgive me if not.

Typically when I am typing up some code in C::B, I really enjoy the way it auto-indents the cursor and moves the ending brace to the next line like so:
From:
for (int i = 0; i < length; i ++) {|}
To:
for (int i = 0; i < length; i ++) {
   |
}


But when I attempt to do this with function definitions, the auto-indent behaves differently (possibly because the definitions aren't previously indented?):
From:
int main() {|}
To:
int main() {
|}


I used the | symbol to symbolize where the cursor is located before/after pressing enter. I have just tried this in the latest C::B Nightly (8455) on Windows XP and still behaves the same. If any more information is needed, please ask.

carra

Quote from: Volatile Pulse on October 16, 2012, 08:38:59 AMBut when I attempt to do this with function definitions, the auto-indent behaves differently (possibly because the definitions aren't previously indented?):
I have seen something that could be related to this. In C::B, when you select several lines of code and press TAB key to indent them, empty lines are not indented. I personally find it annoying, because when you attempt to write in one of those lines you will inadvertedly write an unindented line within indented blocks.