The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5.
Sounds sensible no? But I don't know any editor which does this.
The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5.
Sounds sensible no? But I don't know any editor which does this.
Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default.
OTOH in Emacs you should be able to define a find-file-not-found-functions hook[0] and implement whatever fallback you want. I assume `emacs <file>` calls `find-file` after it's initialised the editor itself.
[0] https://www.gnu.org/software/emacs/manual/html_node/elisp/Vi...
It gets even more fun on Windows! Giving a filename of `foo:5` can result in a file called `foo` with an alternate datastream called `5`.
You're right, but even as an option I think it'd be nice.
vim file +5