Re: [PATCH] startup: add support for <file>:<line> format
Benjamin Valentin <[email protected]>
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
> 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?
It's mostly development tools, addr2line is another one.
> 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.
Sublime Text and VSCode also know about this format.
> If you make that script, please post it here, so others could use it too
> and maybe improve it.
I have this now, but proper integration would be nicer as I don't have
to keep a script around and it would just work™ on any machine.
nanoriot() {
file=$(echo $1 | cut -d : -f 1)
line=$(echo $1 | cut -d : -f 2)
if [ -z "$line" ]; then
nano -E -T4 $file
else
nano -E -T4 +$line $file
fi
}