[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] startup: add support for <file>:<line> format
From: |
Benjamin Valentin |
Subject: |
Re: [PATCH] startup: add support for <file>:<line> format |
Date: |
Wed, 15 Feb 2023 11:37:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:110.0) Gecko/20100101 Thunderbird/110.0 |
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
}