How did we ever live without ctrl-click = find-def?

39 views
Skip to first unread message

Edward K. Ream

unread,
Jul 3, 2015, 9:05:08 AM7/3/15
to leo-e...@googlegroups.com
Recent revs make ctrl-click execute the find-def command if what is under the cursor is not a url.  There is no need to select the word--that's done automatically.

This quickly becomes indispensable. I have the following bindings defined, so there there is no need to move the mouse:

Ctrl-4: find-def
Ctrl-5: find-var

Furthermore, several recent changes/additions are remarkably useful:

clone-to-at-spot

This command does the following:

1. Clones the selected node.
2. Moves the clone to the last child of the last @spot node in the outline.
3. Collapses all nodes in the outline.
4. Selects the newly-cloned node, thereby making it visible.

I typically create the following project node:

   @spot re: the project name

pre-loaded find patterns

Today I improved the clone-find-all commands so they pre-select the find pattern more usefully.  leoPy.leo defines @button cfa-code as::

c.cloneFindAllFlattenedAtNode('Code',top_level=True)

This code now preloads the find pattern before selecting the top-level "Code" node.

These new and improved commands make a big difference to my work flow.

Edward

john lunzer

unread,
Jul 10, 2015, 10:03:39 AM7/10/15
to leo-e...@googlegroups.com
Just got a chance to test this feature out. It's got a lot of potential to improve workflow.

My observations:

Won't find variable (and I assume def) if cursor is at end of word. I understand this is how a lot of stuff works in Leo but with the behavior as is it feels half broken and I don't think a new Leo user would understand why it was failing.

Failed searches transport me to the root node, this is a complete workflow destroyer.  If a search fails then no change in focus should occur at all.

F3 to find next not working as advertised. If I have a var, say w defined in two separate functions in the same node find-var will find the first occurrence and fail to find the next. It always finds the first occurrence even if I do a find-var when my cursor is in front of the var being used in the second function.

The color change of the status bar is useful but the color should not stay indefinitely. It needs to go away either on a subsequent action or after X seconds. Otherwise I'm stuck with a blue or red bar at the bottom of my Leo which is distracting and confusing later on.

Ctrl-left click is great. A suggestion, if it doesn't find anything during it's find-def then it would be great if it tried a find-var. Instead of giving up you expand the Ctrl-left click to both functionalities!

That's all for now, great work Edward.
Reply all
Reply to author
Forward
0 new messages