Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Finding the file offsets for functions



On Sat, May 21, 2022 at 1:17 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Wouldn't
>   vim "+/function $name\\|$name *()" $functions_source[$name]
> be sufficient in nearly all cases?

If you actually need the line number instead of +/, try:

lineno=${"$(grep -n "function $name\\|$name *()" $functions_source[$name])"%:*}




Messages sorted by: Reverse Date, Date, Thread, Author