Sublime Forum

Incorrect docs for command line usage of file:line:col

#1

Attempting to use sublime on the command line I was told by sublime and the entire internet it seems that the correct format is file:line:col. But this just attempted to open up the file with a colon and the line number as part of the filename. Perhaps this is an oversight but it turned out that delimiting by spaces was the correct format. sublime-text.subl --help says:

Filenames may be given a :line or :line:column suffix to open at a specific
location.

But this doesn’t work.
Sublime 3207 on Ubuntu 18.04

0 Likes

#2

Works fine for me. Delimiting with spaces will open three files, e.g. subl file.txt 10 5 will open file.text, 10 and 5. Not sure why the behaviour seems to differ on your machine.

0 Likes

#3

The issue is not that spaces work, its that the documentation says that colons should work, and they do not. And this information is pretty widespread, on many websites and in sublime itself.

0 Likes

#4

I can’t replicate this on Windows, MacOS or Linux (Linux outlined below since that’s what you mentioned you were using).

Your post mentions sublime-text.subl which doesn’t seem like anything that ships with Sublime (though I don’t use Ubuntu so perhaps this is specific to that distro somehow); is that a direct symlink to subl or a script? Perhaps there’s something in the middle that’s messing up the arguments.

0 Likes

#5

I never said that spaces work, they do something very different (opening blank files). Colons work fine for me on macOS.

0 Likes

#6

So this looks like it might have to do with whatever version of Sublime that Ubuntu’s 3rd party software repo has. I may need to report the issue there instead. I have been out of town and haven’t really used my home linux machine so I haven’t checked in on this issue. I’ll dl sublime for linux directly from the website and see if I get different behaviour.

0 Likes