CTRL-Click on <<Named Section>> Moves To That Section

30 views
Skip to first unread message

tbp1...@gmail.com

unread,
Mar 4, 2022, 10:01:31 AM3/4/22
to leo-editor
New in the devel branch - when you CTRL-click on the body on the line containing a <<named  section>>, the selected node will change to the named section's node.

The old behavior of CTRL-click navigating to a UNL or URL is unchanged.

jkn

unread,
Mar 4, 2022, 10:26:48 AM3/4/22
to leo-editor
On Friday, March 4, 2022 at 3:01:31 PM UTC tbp1...@gmail.com wrote:
New in the devel branch - when you CTRL-click on the body on the line containing a <<named  section>>, the selected node will change to the named section's node.

The old behavior of CTRL-click navigating to a UNL or URL is unchanged.

That sounds really useful, thanks!

    J^n
 

tbp1...@gmail.com

unread,
Mar 4, 2022, 11:27:36 AM3/4/22
to leo-editor
: )  Let us know if there are cases it doesn't work for you, so the code can be adjusted.  So far it has worked for me every time.  The named section does have to be in the clicked node's subtree, but that's a normal requirement for a named section anyway.

jkn

unread,
Mar 5, 2022, 9:08:49 AM3/5/22
to leo-editor
TBH I don't use sections much at the moment, but it's the sort of enhancement I like to see. I use CTRL-click on URLs a lot.
 

tbp1...@gmail.com

unread,
Mar 5, 2022, 11:25:58 AM3/5/22
to leo-editor
I've been using them more and more as a kind of pseudo-code to improve readability.  @Edward has said he's been going in the other direction, using @other more.  I mean, something like this speaks more to the program flow than spelling out all the details inline:

<< init >>
<< load data >>
<< restructure data >>
<< create formatted output >>
<< write output >>

Yes, you could make all those sections into functions or methods of the same name, but that can add complication and take longer. Or it could be be done in a later refactoring if that seems worthwhile. or if the sub-block might be useful somewhere else, too.

Reply all
Reply to author
Forward
0 new messages