代码块:更改{}完成的样式 [英] CodeBlocks: Change the style of { } completion

查看:65
本文介绍了代码块:更改{}完成的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用CodeBlocks作为我的C ++ IDE.如果我以"Allman风格"进行编码,那么我的意思是:

I am currently using CodeBlocks as my C++ IDE. If I am coding in "Allman Style", by which I mean this:

foo()
{
    // cursor goes here
}

支撑完成非常令人满意.键入开头{时,它会立即完成结束}并将光标设置在它们之间,并具有正确的缩进级别.

the brace completion is very satisfactory. Upon typing the opening {, it immediately completes the closing } and sets the cursor between them, with correct indentation level.

但是,如果我想使用这种其他样式进行编码,则如下所示:

However, if I want to code in this other style, which looks like this:

foo() {
    // code goes here
}

完成括号对我来说几乎是烦人的.键入开头{之后,仅在按Return键之后,它才完成结束}.此外,我最终得到的是这样:

The brace completion is almost annoying for me. After typing the opening {, only after pressing Return does it complete the closing }. Besides, what I end up with is this:

foo() {
|}

而"|"是光标.如您所见,右大括号仍在同一行上.此外,缩进级别不正确.我希望CodeBlocks在输入开头{

whereas '|' is the cursor. As you can see, the closing brace is still on the same line. Additionally, the indentation level isn't correct. I would like CodeBlocks to give me the following result upon typing the opening {

foo() {
    |
}

而"|"代表光标位置.

Whereas '|' represents the cursor position.

对于我的一生,我无法弄清楚我需要哪种设置.我很确定这是可能的,因为它在第一种样式中效果很好.

For the life of me I can't figure out which setting I need for this. I am pretty sure it's possible, since it works so nicely for the first style.

我希望我能足够准确地解释我的问题,并希望有人可以帮助我解决这个问题.

I hope that I explained my problem precise enough and that someone can help me out with this.

平滑软件

推荐答案

代码:: Blocks版本17.12设置->编辑器->源格式器->选择括号样式Google或Mozilla从上下文菜单使用AStyle格式化任何文件

Code::Blocks version 17.12 Settings->Editor->Source formatter-> select Bracket style Google or Mozilla Use AStyle from context menu for formatting any file

这篇关于代码块:更改{}完成的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆