Eclipse “Toggle Comment” Shortcut Indents on New Projects

我们两清 提交于 2019-12-13 03:57:32

问题


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:

What I want:

    public Test()
    {
        _handler = new Handler();
    }

Becomes

    public Test()
    {
//      _handler = new Handler();
    }

What happens:

    public Test()
    {
        _handler = new Handler();
    }

Becomes

    public Test()
    {
//        _handler = new Handler();
    }

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?

Thanks, Amy

Extra Info:
Eclipse version Indigo, build id 20110916-0149
Android SDK R15 installed


回答1:


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.



来源:https://stackoverflow.com/questions/9931263/eclipse-toggle-comment-shortcut-indents-on-new-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!