SlickEdit Product Discussion > SlickEdit®

Fixing Mixed Tabs and Spaces in C Source Code

(1/2) > >>

bsun:
Hi,
The indentation of my C source files is inconsistent, mixing tabs and spaces.
How can I fix this and set a consistent indentation style (tabs or spaces) in SlickEdit?


--- Code: ---main.c:195:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  195 |     if (!inode->i_cdev)
      |     ^~

--- End code ---

Thanks in advance!

Clark:
You can use the beautifier

bsun:
Thank you for the reply.
Do you mean "Tools -> Beautify"?
If yes, I still have one more question.
How can I set a consistent indentation when I press the "tab"?

Clark:
Yes I mean Tools>Beautify

If you have the Tabs size set to say 8 but the indent amount (Syntax indent) is 4, it's not possible for only tabs to be used. The Tab amount must be the same as the Syntax indent amount (4 and 4 is common but 8 and 8 isn't).

bsun:
I want my Tabs size to be 4 (for all languages). Where can I find this configuration?

Navigation

[0] Message Index

[#] Next page

Go to full version