Posted 19 years ago
by Jason Whitted
-
Owner,
Etalisoft, LLC
![Avatar](https://secure.gravatar.com/avatar/d894d8cc7cd0bb61647a93a1591416cc.jpg?s=64&d=identicon&r=g)
Is there a simple way to do bracket completion?
The language I am working with uses DO...END blocks and I'd like to be able to autocomplete the END bracket when the user types DO and presses enter.
I tried watching the KeyTyping event for the enter key and then checking the previous token to see if it is a DO token and then inserting the text; however, this had an undesired effect. I do not want the block to be autocompleted if the user puts their cursor after an already existing DO token and presses enter.
Is there some event I can use to determine when a token is initially typed/parsed? Or will I need to incorporate a KeyTyping buffer?
The language I am working with uses DO...END blocks and I'd like to be able to autocomplete the END bracket when the user types DO and presses enter.
IF X < 20 THEN
DO|
IF X < 20 THEN
DO
|
END
Is there some event I can use to determine when a token is initially typed/parsed? Or will I need to incorporate a KeyTyping buffer?