Netbeans自动缩进和花括号} { [英] Netbeans Auto-Indentation and Curly Braces }{

查看:349
本文介绍了Netbeans自动缩进和花括号} {的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将NetBeans编辑器设置为自动缩进右花括号?

Is it possible to set up the NetBeans editor to automatically unindent closing curly braces?

我想要这个:

if (something){
    do thing one;
    do thing two;
}

Netbeans给我这个:

Netbeans gives me this:

if (something){
    do thing one;
    do thing two;
    }

,然后我必须删除前面四个令人讨厌的空格.如果在输入右括号后会自动取消缩进,那就太好了.

and then I have to delete the four preceding spaces which is annoying. It would be nice if it would automatically unindent after typing the closing brace.

有什么想法吗?

是否可以使用宏执行此操作?

Is it possible to do this with a macro?

推荐答案

我最终在netbeans论坛上提出了这个问题,结果证明这是一个错误.如果您关闭了自动插入括号",则括号不会自动对齐,但是在打开自动插入括号"的情况下一切正常.

I ended up asking this on the netbeans forums and it turns out that it's a bug. If you have 'auto-insert braces' turned off, the braces won't align automatically, but everything works fine with 'auto-insert braces' turned on.

这篇关于Netbeans自动缩进和花括号} {的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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