Re: [PATCH] startup: add support for <file>:<line> format

Benno Schulenberg <[email protected]>
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Op 30-01-2023 om 15:46 schreef Benjamin Valentin:
> Many tools (e.g. GCC) will output files with line numbers in the format 
> <file>:<line>:<column>.

Many tools?  Apart from compilers, I can think only of 'grep -n'.  What
other tools produce "filename:linenumber" output the user might want to
feed to nano?


> +			/* search for : to open file on a specific line , ignore if filename starts with : */

Why ignore filenames that start with a colon?  There still could be a colon
plus line number appended, no?  So, instead a filename with a leading colon
should be treated as if the colon were escaped, I think.


But... of the editors I tried, only geany understands the name:number format;
vim, emacs, joe, ne, gedit... do not.  So, there will be hardly any users that
will hope/expect this format to work in nano.

Also, if you really want this feature, you could write a wrapper script that
transforms "name:number" to "+number name" -- no need for nano to implement
this, and no need to impact people that have filenames with colons in them
followed by digits.

(If you make that script, please post it here, so others could use it too
and maybe improve it.)

Benno
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.