0

I have to submit an assignment and they want all the indents to be 3 spaces. I don't know how to change the settings of Astyle.dll so that it will change them 3 spaces instead of the default 4. Any ideas?

Also, Astyle seems to like having no indent between switch() and its cases, and I need there to be an indent there. Any ideas?

4

1 回答 1

3

Astyle 的所有设置都显示在 Code::Blocks 编辑器设置对话框中。要访问它们,请打开Settings菜单,单击Editor,然后滚动侧边栏以查找Default code条目。

我必须提交一个作业,他们希望所有缩进都是 3 个空格。

切换到侧边栏中的Indentation选项卡,Source Formatter然后更改Indentation size (in spaces):为 3。

此外,Astyle 似乎喜欢在 switch() 及其案例之间没有缩进,我需要在那里有一个缩进。

如果我正确理解您的需求,请选中显示的框Indent switches (keyword case:)并选中显示的框Indent case: statement in switches (commands under case:)

您也可以更改所需的任何其他设置。完成后,点击OK,然后重新格式化您的代码并确保按照您想要的方式设置设置。

于 2014-05-07T07:16:48.043 回答