When Does CTRL-Clicking On Functions/Methods/Classes Work?

18 views
Skip to first unread message

Thomas Passin

unread,
May 12, 2023, 8:44:33 AM5/12/23
to leo-editor
I'm used to CTRL-clicking on function names, etc, to move directly to their defs.  I assumed that this would work for basically any programming language.  But when I just tried it in a javascript code base, nothing happened for a CTRL-click.

Is this capability limited only to Python code?  What are the limitations I can expect?

Edward K. Ream

unread,
May 12, 2023, 10:42:10 AM5/12/23
to leo-e...@googlegroups.com
On Fri, May 12, 2023 at 7:44 AM Thomas Passin <tbp1...@gmail.com> wrote:
I'm used to CTRL-clicking on function names, etc, to move directly to their defs.  I assumed that this would work for basically any programming language.  But when I just tried it in a javascript code base, nothing happened for a CTRL-click.

Is this capability limited only to Python code?  What are the limitations I can expect?

I have no idea :-) My guess is the same as yours.

Edward

Thomas Passin

unread,
May 12, 2023, 3:20:44 PM5/12/23
to leo-editor
Looks like it's almost Python-specific:

    table = (
        (f"class {word}", self.do_find_def),
        (f"def {word}", self.do_find_def),
        (f"{word} =", self.do_find_var),
    )


(in @cmd('find-def'))

Félix

unread,
May 12, 2023, 3:21:28 PM5/12/23
to leo-editor
This only works for python: it searches for "Class XXX" or "def XXX" 
(could be relatively easily be adapted to support other laguages based on regex for each languages)

Félix

On Friday, May 12, 2023 at 10:42:10 AM UTC-4 Edward K. Ream wrote:
Reply all
Reply to author
Forward
0 new messages