[wingide-users] Brace matching

Torsten Marek shlomme at gmx.net
Wed Nov 12 15:34:36 MST 2008


Am Mittwoch, den 12.11.2008, 09:51 -0500 schrieb Wingware Support:
> Torsten Marek wrote:
> > is there a way to make Wing only match braces immediately left to the
> > cursor, and never a brace under the cursor? Currently, the default seems
> > to be that first, the editor checks for a brace under the cursor (at
> > point, in emacs speak), and only if none is found, it looks to the
> > right. 
> 
> Assuming you mean the Match Braces feature in the Source menu, there isn't
> a way to alter how that works now although you could write a small script
> to move the cursor to the right one and then do the brace match.  Also
> doing Match Braces twice in a row may get you want you want.

Hi Stephan,

no, I mean the auto-brace highlight in the editor.


Example:
    1   2   3    3   21
test(foo(bar(1, 2), 2))

When I put the cursor *on* the closing 3, it'll highlight the opening
and closing 3. When I put it after it, as well. However, when I put it
*on* the closing 1, after the closing 2, it will highlight the opening
1.

I would like the editor always only highlight the brace immediately
before the cursor, so that brace pair 2 is highlighted if the cursor is
exactly on the closing 1.



> 
> A script would look something like this:
> 
> import wingapi
> def my_brace_match():
>    app = wingapi.gApplication
>    ed = app.GetActiveEditor()
>    if ed is not None:
>      app.ExecuteCommand('forward-char')
>      app.ExecuteCommand('brace-match')
> 
> You may need to refer to the scripting documentation if you try this:
> 
> http://wingware.com/doc/scripting

I've thought of this as well, but this is an extra keystroke I'd like to
save myself:)


best,


Torsten
-- 
.: Torsten Marek
.: http://shlomme.diotavelli.net
.: torsten at diotavelli.net -- GnuPG: 1024D/A244C858

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : /pipermail/wingide-users/attachments/20081112/b8933556/attachment.bin


More information about the wingide-users mailing list