Change starting line number of SublimeText
Asked Answered
T

1

6

I have access to a small portion of a code file, when I get an exception, the line number in the exception will refer to the entire code file, rather than just the section I have access too.

This means I'll get a error message for line 300, which is actually line 5 in my code file. The starting number varies depending on the file I'm working on.

To get around this at the moment, I just insert the relevant number of blank lines so that my line 1 lines up with where it will in the parent file.

I'd like to know if there is a way to get the line numbers in Sublime to start at something other than 1.

That way I'd be able to set the first line number in my file to the actual line number it will be when its inserted into the parent file.

Teilo answered 10/11, 2015 at 3:17 Comment(1)
I have the same problem the other way around. I'm developing a procedural database script that includes 175 lines of introductory comments and code that are handled by my client application and by the server in a different context, so if the server flags line 30 in my code, it's really line 205 in my text document. My work-around right now is to add more lines of garbage until the difference is a dead-easy number, since adding 200 or 1000 in my head is a little less distracting than subtracting 175.Outcast
M
4

The line numbers in Sublime are based on the number of lines that are actually in the current view. There is no method in the API to alter their appearance, unfortunately.

Mulley answered 10/11, 2015 at 13:55 Comment(1)
Thanks, I thought that might be the case, but hoped otherwise.Teilo

© 2022 - 2024 — McMap. All rights reserved.