Eclipse“切换评论"新项目的捷径 [英] Eclipse "Toggle Comment" Shortcut Indents on New Projects
问题描述
今天我注意到,现在当我在Eclipse(.java文件)中按Ctrl +/时,它的确用//注释了它们,但现在将文本移到了上面.但是,使用当前工作区中的较旧项目进行测试时,它的作用与以前一样-该行保持相同的缩进量.例如:
Today I noticed that now when I Ctrl+/ one or more lines in Eclipse (.java files) it does comment them with //, but now moves the text over. However, testing this with older projects currently in the workspace, it acts as before - the line remains at the same indentation. For instance:
我想要的东西:
public Test()
{
_handler = new Handler();
}
成为
public Test()
{
// _handler = new Handler();
}
会发生什么:
public Test()
{
_handler = new Handler();
}
成为
public Test()
{
// _handler = new Handler();
}
我尝试创建一个新的Java项目和一个新的Android项目(我使用的两个项目),但都遇到了问题.他们没有启用特定于项目的设置.我还使用了自定义的Formatter配置文件,但是使用三个内置配置文件中的任何一个都可以完成相同的工作.
I tried making a new Java project, and a new Android project (the two I use), and both had the problem. They do not have project-specific settings enabled. I also use a custom Formatter profile, but using any of the three built-in ones did the same thing.
有人知道如何解决此问题,以使行保持相同的缩进量吗?
Does anyone know how to fix this so it keeps the line at the same indentation?
谢谢, 艾米
其他信息:
Eclipse版本Indigo,内部版本ID 20110916-0149
已安装Android SDK R15
Extra Info:
Eclipse version Indigo, build id 20110916-0149
Android SDK R15 installed
推荐答案
您的问题可能是两个项目中的制表符和空格.制表符可能会吸收多余的字符用于注释,而缩进的所有空格不会吸收注释字符.
Your problem could be tabs versus spaces in the two projects. Tabs may absorb the extra characters for commenting, whereas all-spaces for indenting does not absorb the comment characters.
这篇关于Eclipse“切换评论"新项目的捷径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!