nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Benno Schulenberg
Subject: Re: [PATCH] startup: add support for <file>:<line> format
Date: Wed, 1 Feb 2023 11:35:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2


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

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]