Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Finding the file offsets for functions
- X-seq: zsh-users 27787
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zach Riggle <zachriggle@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Finding the file offsets for functions
- Date: Sun, 22 May 2022 18:16:39 -0700
- Archived-at: <https://zsh.org/users/27787>
- In-reply-to: <CAH+w=7Zniv+gBN_cTZH3Hm3p+Wd4r+em0DkucuzirkVccShDbg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5n4Tho2-ddGNKbf1mFa7ZdtdHRSMN-dv3NcsudAGNKXQQ@mail.gmail.com> <CAH+w=7Zniv+gBN_cTZH3Hm3p+Wd4r+em0DkucuzirkVccShDbg@mail.gmail.com>
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