Netbeans 中的自动换行注释

发布于 2024-11-30 13:18:08 字数 300 浏览 1 评论 0原文

/*
 *
 * 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

清风无影 2024-12-07 13:18:09

就目前而言,当前的 NetBeans (7.3) 在格式化时使用一些可用的额外选项对注释进行自动换行。 注意:不幸的是,这目前仅适用于 Java 语言。

您可以使用上下文菜单 →Format 启动格式化程序,或者如果您没有更改标准快捷键, Alt+Shift+F 应该可以。

访问相应的配置:ToolsOptionsEditorFormatting语言Java类别评论

Netbeans 评论格式选项


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: ToolsOptionsEditorFormatting; Language: Java; Category: Comments

Netbeans comments formatting options


短暂陪伴 2024-12-07 13:18:09

您的 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.

凉薄对峙 2024-12-07 13:18:09

如果您按 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:

Tools > Options > Editor > Formatting > Right Margin

Is this what you're looking for?

对你再特殊 2024-12-07 13:18:09

转到工具->选项->编辑器->格式
找到换行并选择一种您想要的换行样式,有两个选项:后记和任何地方。
然后单击“确定”! :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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文