/* 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 быть количеством строк) для фиксации каждой строки так, чтобы они примерно выстроились в линию снова. Компьютер должен сделать это, не меня.
Там инструменты должны иметь дело с этим в наших IDE? Чем их называют?
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.
*/
В Eclipse это встроено (по крайней мере, я думаю, это то, что вам нужно). Когда вы вводите комментарий, вы набираете Ctrl+Shift+F, и он форматирует либо весь ваш код, либо только выделенную часть кода.
Я только что протестировал его, и он выровнял все мои комментарии.