如何在 intelliJ IDEA 中的注释行内的版权文本上方插入一个空行?

发布于 2024-09-04 00:53:41 字数 920 浏览 1 评论 0原文

我正在使用 intelliJ IDEA 9。

它具有制作版权配置文件并应用于我创建的所有文件的功能。 我想做的是格式化版权评论权。

假设我有这样的版权文本: 版权所有 (c) 2010 my.company。版权所有。

我希望它自动插入到文件中,如下所示:

////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 my.company. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////

但是当我输入“Copyright (c) 2010 my.company。保留所有权利”这一行时。在版权配置文件中(不带引号)并配置格式以使用行注释和边框等,我只能使其显示如下:

////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010 my.company. All rights reserved.
////////////////////////////////////////////////////////////////////////////////

即使当我将上下有空行的版权文本放入模板时,如下,结果还是和上面一样。

    Copyright (c) 2010 my.company. All rights reserved.

它似乎忽略了版权模板中的空白行。 有什么方法可以配置它,以便版权文本在注释中的上方和下方有空行?

I'm using intelliJ IDEA 9.

It has a function to make a copyright profile and apply to all files I create.
What I'm trying to do is to format the copyright comment right.

Suppose I have a copyright text as this:
Copyright (c) 2010 my.company. All rights reserved.

I wish it to be inserted in files automatically as following:

////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 my.company. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////

But when I enter the line "Copyright (c) 2010 my.company. All rights reserved." in the copyright profile (without quotes) and configure the formatting to use line comment and borders, and so on, I can only make it to display as below:

////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010 my.company. All rights reserved.
////////////////////////////////////////////////////////////////////////////////

Even when I put the copyright text with blank line above and below to the template, as following, it still comes out like above.


    Copyright (c) 2010 my.company. All rights reserved.

It seems to ignore blank lines in the copyright template.
Is there any way to configure it so the copyright text will have blank lines above and below within the comments?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

小耗子 2024-09-11 00:53:41

在@sblundy 的提示之后,我明白了。

#set($blankLine = '')
${blankLine}
Copyright (c) 2010 my.company. All rights reserved.
${blankLine}

凉爽的。现在可以了。

Figured it out, after the tip from @sblundy.

#set($blankLine = '')
${blankLine}
Copyright (c) 2010 my.company. All rights reserved.
${blankLine}

Cool. Now it works.

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