I finally have time to look into the workings of Syntax editor (with plans to migrate from a Codemax [COM] implementation) and I immediately noticed 2 strange things about your bracket matching implementation.
This may be specific to Dynamic languages (I am hoping to use Dynamic languages as I have to support 12 different SQL dialects and I really dont want to have to code 12 different code based languages. But I don't currently see any way to differentiate between tokens that are used in 2 contexts.)
It seems that you highlight the brackets ONLY when the cursor is immediately before the Start 'token' or immediately after the End 'token'. This is no problem if the tokens are only one character long but it is very non-intuative if the tokens consist of multiple characters. eg. CASE ... END CASE
Users expect the brackets to be highlighted if they click ANYWHERE within the token.
(The only exception would be either before or after the token. Using your current logic it would not highlight after the Open token or before the Close token. Personally I prefer consistancy so I would prefer it to work either before or after [but not both] both tokens)
The second oddity is that the token is highlighted even if the corresponding token does not exist.
For example, if I omit the 'end case' in the example above and then place my cursor immediately before the starting 'case' token then the token is highlighted ... even though there is no match for it.
That rather defeats the purpose of brace matching. Users often click on a start keyword to verify that the matching end token exists. The end token may not be currenty visible, but if the start token is highlighted they assume it must exist without scrolling down to check.
Is there any way to correct this behaviour when using a dynamic language.
Can it be corrected if I write my own code based language?
thanks