7

is it possible we have the option of adding line numbers to the beginnings of the code lines added to the questions and answers? This is a needed fonctionality especially when responding to the long code lines.

ps. This is a duplicate of this question. But I want to ask this feature-request again, because the question owner there accepted a response which mentions that this feature is unnecessary. I think that it is a necessary feature. His acceptantation does not reflect my needs. Please do not downvote this question because of the duplicateness. Instead of downvoting for duplicateness, you can tell me the alternative way of asking the same feature-request in your comment. Thanks.

EDIT: Hope I could explain the problem. Thanks for the downvotes.

2
  • 5
    The alternative is you can answer that question and suggest how this feature can be useful. Or start a bounty with such reasons.
    – Himanshu
    Commented Jan 21, 2014 at 10:10
  • Asking not to downvote is usually a magnet for downvotes, so it is rarely a good idea to discuss it in the question itself. And I hope my answer on your other question explains how to appropriately handle getting attention to an existing feature request. Commented Jan 21, 2014 at 11:13

1 Answer 1

9

You can add line numbers yourself, for example using Notepad++ (like described here):

Notepad++ can do that by using the TextFX plugin. Select the lines and then select TextFX->TextFX Tools->Insert Line Numbers from the menu bar.

Then search&replace ^0+([0-9]+)\s with \1 to remove trailing 0s

However, anyone who would like to copy the text, would copy if together with line numbers, therefore it would be useful to create code box with line numbers and code in separate blocks, so you can easy code the code, like here: http://www.primefaces.org/showcase/ui/selectManyCheckbox.jsf

I think it would be nice feature (activated by special markup), if it's not hard to implement. It shouldn't be hard to do, because there are a lot of implementations already available.

Not the answer you're looking for? Browse other questions tagged .