问题描述
当我在Intellij中编写代码时,我经常通过键入以下类型的序列来创建新块:
When I'm writing code in Intellij, I often create new blocks by typing these types of sequences:
if (test) {
打开那个打开的大括号会导致Intellij自动插入一个右括号并在两者之间移动光标两个大括号:
Typing that open curly brace causes Intellij to automatically insert a closing brace and move the cursor between the two braces:
if (test) {|}
此时,我只需按Enter即可获得一个格式正确的块,光标位于应该的位置:
At this point, I simply press Enter and get a nicely formatted block with the cursor right where it should be:
if (test) {
|
}
然而,今天Intellij正在向块中添加一条额外的行,如下所示:
However, today Intellij is adding an extra line to the block, like this:
if (test) {
|
}
我看了整个项目和IDE设置,但我不知道该改变什么。仅供参考,它发生在不同类型的项目(Spring / Java,Node / Express)中的各种文件类型(.java,.js,.css)中。任何人都知道如何解决这个小麻烦?
I've looked all over the project and IDE settings, but I'm not sure what to change. FYI, it's happening in various file types (.java, .js, .css) across different types of projects (Spring/Java, Node/Express). Anyone know how to fix this little annoyance?
推荐答案
截至5MAR2015,解决方案是禁用Gauge插件。归功于@KaPaHgaIII
As of 5MAR2015 the solution is to disable the Gauge plugin. Credit for this goes to @KaPaHgaIII
这篇关于Intellij在新块中添加额外的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!