/* Suppose I have a multi-line comment with hard line-breaks
* that are roughly uniform on the right side of the text,
* and I want to add text to a line in order to make the
* comment a bit more descriptive.
*/现在,,最不幸的是,,我需要将文本添加到顶部的行之一。
/* Suppose I have a multi-line comment with hard line-breaks (here is some added text for happy fun time)
* that are roughly uniform on the right side of the text,
* and I want to add text to a line in order to make the
* comment a bit more descriptive.
*/修复每一行需要O (n )时间(n是行数),以便它们大致重新排列。电脑应该这么做,而不是我。
在我们的IDEs中有处理这个问题的工具吗?他们叫什么?
发布于 2010-03-08 17:21:46
emacs支持命令fill-paragraph,该命令通常映射到meta-q。
fill-paragraph对文本第二段的输出:
/* Suppose I have a multi-line comment with hard line-breaks (here is
* some added text for happy fun time) that are roughly uniform on the
* right side of the text, and I want to add text to a line in order
* to make the comment a bit more descriptive.
*/发布于 2010-03-08 17:23:49
Eclipse内置了这个(至少,我认为这是您想要的)。键入注释时,键入Ctrl+Shift+F,它将格式化所有代码,或仅设置突出显示的代码部分。
我刚刚测试了它,它为我调整了我所有的评论。
https://stackoverflow.com/questions/2403191
复制相似问题