I have checked the ‘Insert Spaces for TABs’ option, but TABs are still being inserted.
It seemed extremely convoluted to find the option at all, so I wouldn’t be surprised if I’ve not found the right place and/or not found all the places where it has to be set to actually be effective…
So, How do I get M2MStudio to actually insert spaces for TABs??
I the case of using “old” files, if you introduce new text, the tabs are introduced as a tab or as spaces? Maybe it convert the tabs into spaces when you type them.
ie, when you press the ‘TAB’ button, it should insert the appropriate number of spaces, but it doesn’t - it inserts TAB characters.
The fact that it is inserting TAB characters is clearly seen by enabling ‘Show Whitespace Characters’ (which also shows the spaces being inserted in the “new” files where the setting is working correctly)
I did that using File > New > Other > Untitled Text File.
If I choose ‘Header File’ or ‘Source File’, then TAB characters are used.
These options use the “Templates” - so I guess it must be something to do with those templates…?
Seems that the C editor is not inheriting the global editor settings about space/tabs management, but uses its own settings…
And that’s well hidden: go to Window > Preferences > C/C++ > Code Style > Edit…
Change the tab policy, save to a new profile name, and it should be OK
I suppose it’s not an unreasonable place to put it, but I really think that there needs to be a note by the more “obvious” setting to point out what it does & doesn’t affect.
Actually, you have to create a new profile first, then edit it.
This is a really bad interface feature - you get an ‘edit’ button for the built-in profiles, and it will let you change the settings as much as you like, but you can’t save them!
If the ‘Edit’ button isn’t really going to allow you to properly edit a built-in profile (which must include saving the changes), then it should either be greyed-out or have a different name.
(It manages to grey-out ‘Remove’ - so the basic functionality is already there…)
Or there should be a ‘Save as…’ within the Profile Editor.