MCUxpresso - automatic closing brace in C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCUxpresso - automatic closing brace in C

Jump to solution
1,218 Views
jmullen_condose
Contributor III

In CodeWarrior I would enter a code such as:

if(foo){
    cursor_here;
}

and the closing brace would be added automatically, with cursor placed at "cursor_here;" ready to enter the code block. With MCUxpresso I have searched forums and Guides but cannot get this to work the same. There is a setting for "Braces" but it is set on yet the editor still leaves the closing brace to be typed manually.

Small thing, but after 10 years of CW functioning like this, I am caught almost every time missing this as I code now in MCUx.

Is there a setting I am missing?

Cheers!

0 Kudos
1 Solution
1,215 Views
converse
Senior Contributor V

That is exactly how it works for me in MCUXpresso. It is standard Eclipse CDT behaviour in the C/C++ Editor. You must have changed a setting somewhere, to stop it working

View solution in original post

0 Kudos
3 Replies
1,214 Views
converse
Senior Contributor V

There is a setting for this - see attached screenshot.

 

0 Kudos
1,216 Views
converse
Senior Contributor V

That is exactly how it works for me in MCUXpresso. It is standard Eclipse CDT behaviour in the C/C++ Editor. You must have changed a setting somewhere, to stop it working

0 Kudos
1,209 Views
jmullen_condose
Contributor III

Thank you for verifying!

Turns out is was just a single source.c file that was acting this way. I believe I had made a mistake creating the file and added ".c" to it via "rename" after, then pasted in the old code from CodeWarrior I had. This one file acted like Java and would not provide closing braces, all 10 other source files were working correctly when I tested them. I renamed that one file to 'delete.me', created a new one with the desired name, correctly this time, and pasted code over, deleted the 'java-style' file and all is very well. Thank you again for your help!

0 Kudos