Netbeans 中的自动换行注释
/*
*
* This is a long comment. I broke it into lines, but that made it impossible to edit without screwing up the formatting. Is there a way to make Netbeans add line breaks automatically?
*
*/
阅读:这是一条很长的评论。我把它分成几行,但这使得在不搞乱格式的情况下进行编辑变得不可能。有没有办法让 Netbeans 自动添加换行符?
/*
*
* This is a long comment. I broke it into lines, but that made it impossible to edit without screwing up the formatting. Is there a way to make Netbeans add line breaks automatically?
*
*/
Reads: This is a long comment. I broke it into lines, but that made it impossible to edit without screwing up the formatting. Is there a way to make Netbeans add line breaks automatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
就目前而言,当前的 NetBeans (7.3) 在格式化时使用一些可用的额外选项对注释进行自动换行。 注意:不幸的是,这目前仅适用于 Java 语言。
您可以使用上下文菜单 →
Format
启动格式化程序,或者如果您没有更改标准快捷键, Alt+Shift+F 应该可以。访问相应的配置:
Tools
→Options
→Editor
→Formatting
;语言
:Java
;类别
:评论
As for today, the current NetBeans (7.3) word-wraps comments with some nice available extra options when formatting. NB: Unfortunately, this is currently only available for the Java language.
You can launch the formatter with the context menu→
Format
, or if you did not change the standard shortcuts, Alt+Shift+F should do.To access the corresponding configuration:
Tools
→Options
→Editor
→Formatting
;Language
:Java
;Category
:Comments
您的 IDE 不会为您格式化注释。你必须手工完成。是的,这意味着一旦添加新单词,您就必须重新格式化它。
Your IDE won't format the comment for you. You will have to do it by hand. Yes, that means you have to re-format it once you add new words to it.
如果您按 Enter 插入新行,NetBeans 将简单地扩展文档块格式 - 它不会破坏任何内容。首选项中还有一个有用的选项,可以在右边距中显示一条线,以便您知道何时换行。它位于:
这是您要找的吗?
If you press Enter to insert a new line, NetBeans will simply extend the docblock formatting - it won't break anything. There's also a useful option in the Preferences to display a line in the right margin, so you know when to break a line. It's in:
Is this what you're looking for?
转到工具->选项->编辑器->格式
找到换行并选择一种您想要的换行样式,有两个选项:后记和任何地方。
然后单击“确定”! :D
nb : 我建议你选择后记
Go to tools->options->editor->formatting
find line wrap and choose one the wrapping style you desire,there are two options : afterword and anywhere.
and then click OK! :D
nb : I suggest you to choose afterword