键入右括号时禁用Intellij IDEA代码重新格式化 [英] Disable Intellij IDEA code reformatting when closing brace is typed in

查看:726
本文介绍了键入右括号时禁用Intellij IDEA代码重新格式化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Intellij IDEA似乎想在输入右括号后重新格式化括号内的代码块。例如,如果我有一个代码块,我现在想要在try / catch块中包装,一旦我输入try块的右括号,整个try块就会自动重新格式化。我在设置中搜索过,但是找不到任何可以解决这个问题的东西。有什么想法?

Intellij IDEA seems to like to reformat the code block inside braces once the closing brace is entered. For example, if I have a block of code that I now want to wrap in a try/catch block, once I type in the closing brace of the try block, the entire try block automatically gets reformatted. I have searched in settings but was not able to find anything that would turn this off. Any ideas?

推荐答案

是。

文件 - >设置 - >编辑器 - >常规 - >智能键

File --> Settings --> Editor --> General --> Smart Keys

然后取消选中键入时重新格式化'}'

Then uncheck the option "Reformat block on typing '}'"

申请 - >确定

这篇关于键入右括号时禁用Intellij IDEA代码重新格式化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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