在我从吉特拉布(Gitlab
我首先从gitlab中克隆Java代码。 然后,我在没有修改任何代码的情况下使用编辑器打开Java类之一。 我发现每个方法的相对缩进在任何Java类中都消失了。 我尝试使用多个编辑器(包括Intellij Idea,sts,notpad ++)打开课程。 但是,当我使用NotPad时,该纸条本身安装在Win10中。它按预期进行。 这是Intellij Idea,sts,notpad ++开启的结果: 在此处输入图像描述
public ElasticSearchRepository(Class<E> entityClass) {
this.entityClass = entityClass;
}
这是win10:notpad in win10:
public ElasticSearchRepository(Class<E> entityClass) {
this.entityClass = entityClass;
}
I clone the java code from gitlab firstly.
Then I open one of the java classes with a editor without modifying any code.
I find the relative indent of every method body disappear in any java class.
I tried to open the class with more than one editor, including intellij idea, sts, notpad++.
But When I use notpad which is installed in win10 natively. It goes as expected.
This is the result opened by intellij idea, sts, notpad++:
enter image description here
public ElasticSearchRepository(Class<E> entityClass) {
this.entityClass = entityClass;
}
This is the result opened by notpad in win10:
public ElasticSearchRepository(Class<E> entityClass) {
this.entityClass = entityClass;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是标签字符中默认空间的缩进设置的差异。
A. Intellij
in
Intellij
您可以执行此操作B. Vscode
首选项
&gt;设置
如果您使用的是MacOS(快捷方式:命令 +,
)。首选项
&gt;设置
如果您使用的是Windows(hotkey:ctrl +,
)。凹痕
进入搜索字段,然后前往编辑器:TAB Size
部分。将默认空间编号替换为您的首选:C。ATOM中的Atom
cmd +,
选项卡长度
并输入您喜欢的内容。D. Notepad ++
更改选项卡键的默认操作:
替换为Space
的复选框。您可以检查一下以使用空间或在此选项上方设置标签字符的nmber空间。E. Komodo编辑
命令 +,
和PC上,希望Control + P
。This is a difference in the indent settings of the default number of spaces in a TAB character.
A. Intellij
In
IntelliJ
you can do thisB. VSCode
Preferences
>Settings
if you’re using macOS (shortcut:Command + ,
).Preferences
>Settings
if you’re using Windows (hotkey:Ctrl + ,
).Indentation
into the search field then head to theEditor: Tab Size
section. Replace the default space number with your preferred one:C. Atom
CMD + ,
Tab Length
and input what you prefer.D. Notepad++
To change the default action of the tab key:
Replace by space
. You can check this to use spaces or set the nomber of spaces for your tab character above this option.E. Komodo Edit
Command + ,
and on PC, hopefullycontrol + p
.