Setting Line Numbers for Only Actual Code


Hello, I’m very new to programming and I’m taking an online course right now. The programming I’m doing involves jumping to specific lines of code in the command itself, but the simulation software that runs the code only counts actual code as those numbers. So if I skip lines or add comments on new lines in Atom the numbers don’t line up with the actual location of the code that is run.

Is there a way to have atom only number actual code, or a key stroke that will have it ignore numbering the current line and have it jump to the next?

Thank you!



No, there isn’t a feature of Atom for this. Most people’s definitions of “code” and “not-code” would vary depending on the context and it sounds like you would need something that exactly matches your simulator’s method of interpretation.


A package could be made to create a new gutter for your particular language, iterate through the lines in the buffer and check whether they’re blank or comments.


Thank you! I actually found a workaround anyway now that this week’s lesson has now gotten to branching and variables. I no longer have to define the jump destination using the exact line of executable code, I can simply label it how I wish and it will go there. :slight_smile:


I’m not sure I’m at the level to be able to do that well or efficiently, but when I’m good enough I look forward to making little mod programs in Atom to suit my and perhaps others’ coding needs. It’s one of the main reason why it’s my Text editor of choice, the other being I’m so new to this I have no way of rating one over any other with relevant judgment. :slight_smile:


And I’m loads better at identifying something that can be done, mapping out the route it would take, and finding the appropriate functions to do it than actually putting things together. Might be an attention span thing


I’m not sure if I have those skills intuitively, I was actually a piano major (classical and improvisational jazz), but I know I’m fascinated by the challenges and see how much of it is creative like an improvised solo or composition so to speak, and feel great satisfaction every time I implement code (at my level) that does what it sets out to do. Imma keep at it, that’s for sure!