Could you explain how code formating works? I dont get it 

Sorry for being so late with an answer:
There are two formating features:
- If a new line is inserted, the indentation of the previous line is preserved and if the previous line ends with '{' an additional '\t' is added. If an '}' is typed the indentation is decreased.
- Right click in the editor window to bring up the context menu. There you find a "Format" menuitem, which processes the whole document and changes indentation. It is a rather simple minded formater and spaces are converted to '\t' automatically.