- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw this was asked a few years ago with no solution. Is there a way to auto format c code in creator? As in something to make all of the indentations line up and look nice.
Solved! Go to Solution.
- Tags:
- psoc 6 creator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi RyWi_4724536,
Adding to Kenshow-san's response, PSoC Creator does not correct the indentation.
Considering your example, when you type if(x>0){ and press Enter, PSoC Creator auto indents the code as shown -
However, if you have to correct the indentation, then you will have to do it manually.
How do you indent/uindent a block of code?
You can select the block of code that you want to indent and press Tab. Shift+Tab unindents the block of code.
Thanks and Regards,
Rakshith
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi RyWi_4724536,
Can you please point me to the discussion that you are referring to? It might help me understand your request better.
There is an automatic indentation feature in PSoC Creator that provides indentation after an open bracket etc. You can also indent/unindent a block of code.
However, if you want the indentation of the entire source file to be fixed automatically, then, unfortunately, that feature is not available in PSoC Creator.
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rakshith
I was hoping for indenting the whole file or a selection.
Say the code is:
if(x>0){
x=0;
}
I'd want it to change to:
if(x>0){
x=0;
}
It doesn't sound like Creator can do that though....
How do you indent/uindent a block of code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I couldn't find that feature in Creator, but Modus Toolbox 2.1 has it.
Window > Preferences > C/C++ > Editor > SaveActions, and check "Format source code"
Regards,
Kenshow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi RyWi_4724536,
Adding to Kenshow-san's response, PSoC Creator does not correct the indentation.
Considering your example, when you type if(x>0){ and press Enter, PSoC Creator auto indents the code as shown -
However, if you have to correct the indentation, then you will have to do it manually.
How do you indent/uindent a block of code?
You can select the block of code that you want to indent and press Tab. Shift+Tab unindents the block of code.
Thanks and Regards,
Rakshith
Rakshith M B