This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: deleting tab instead of spaces

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hi,

How can i configure code compose as after pressing tab each click on backspace delete tab not just one space ?
I searched online and the checkbox "insert spaces for tabs" is unchecked so what should i do ?

Best Regards.

  • Mohamed,

    The backspace key is going to delete the previous character.  Thus if you are seeing it delete a space instead of a tab that means that the editor is still inserting spaced for tabs.  Note that using spaces instead of tabs is recommended for OS compatibility.

    I am guessing that you have tried this option and it is not working:

    I believe what is happening is that the code formatter settings override this.

    To change the formatter is a little more complicated.

    Go back to the preferences dialog

    Click on "Show advanced settings at the bottom left"

    Then navigate to here:

    On the right hand site click on the edit button.

    Then click on the Indentation tab and make sure that the tab policy is set to "Tabs only" and check the box to "Use tabs only for leading indentations"

    If I do that then I am getting tabs instead of spaces.

    Regards,

    John

  • Still the same issue.

    Best Regards.
  • Mohamed,

    Can you let me know what version of CCS you are using. I tried the above settings on multiple CCS installations on different operating systems and doing so caused tabs to be used instead of spaces.

    Regards,
    John
  • Another thing to watch for is that it is possible to control these settings on a per project basis.  Above I was setting the global preferences via the preferences dialog accessed via the Window menu (or application menu on macOS).   If you set the options via the project properties like below then it will only apply to the project.  Also if you change the global preferences but have project specific preferences set then the project ones are used.

  • Thank you.
    Best Regards.