Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change starting line number of SublimeText

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.

like image 285
Des Horsley Avatar asked Nov 10 '15 03:11

Des Horsley


People also ask

How do I get line numbers in Sublime Text?

Just hit Ctrl + G , and it does the same steps for you!

How do I replace multiple lines in Sublime Text?

To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line. When you're done with using multiple selections, just press Ctrl+K to trim all but the first.


1 Answers

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.

like image 76
MattDMo Avatar answered Sep 29 '22 15:09

MattDMo