On Mon, 26 Feb 2018 07:00:20 -0800 (PST)
"Edward K. Ream" <[email protected]> wrote:

> Leo's match-brackets command is an essential tool when trying to make
> sense of javascript files.

Took longer than I anticipated, but I've just changed the way the
match-brackets command works :-)  On the 5.8-dev branch ;-)

Previously it looked either side of the insert point for a bracket, and
acted on that bracket.  Now it extends that search outwards from the
insert point indefinitely to find a bracket.  This lets you select the
enclosing scope without having to navigate to one end of it.

Then it counts the number of times the matched bracket range has had
the same answer.  First time is the first time.  Second time, it
selects the other end of the range, which is what it did before.
Third time, it attempts to select a range enclosing the current range,
if it can find one.  That's new.

The "bracket closest to the insert point" can be a little odd, e.g.:

^def func(param, param2):

with the insert function at the ^, it would select "(param, param2)",
probably, but if the code was:

   ...
   ...
   print('something')

^def longish_function_name(param, param2):

it would select "('something')", seeing that's closest.  I don't think
that's a big deal, you'd usually have the insert point inside the
scope, so there's no ambiguity, and if you want to use it to select
param lists, just go to the end of the def line first.  Probably not a
typical use anyway.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to