Arm Mbed OS support forum

Auto-format and indentation definition

The autoformat option in MBED Studio indents code by two spaces (like in Arduino IDE).
However, the tab button produces 4 spaces (which is I think the most conventional in programming).

The autoformat result does not match with normally edited code.

I would suggest to include a setting for tab definition (4 spaces by default), and apply that setting to both the auto formatter and the tab key.

On Windows 10, Mbed Studio 1.3.1

Hi Robert,

You can change indentation on the bottom bar (bottom-right corner in Studio). You should be able to change between tabs and spaces. Including setting the default tab definition (1-8 spaces).

Thanks,
Arek - Studio team

1 Like

Thank you for your reply.

Ah, I hadn’t noticed it, thanks.
But still, the auto-formatter ignores this setting: it formats everything with 2 spaces, even though the setting is at 4.