Custom Language: How to make a closing brace unindent?

The custom language plugin I'm implementing supports a language which has scoping braces similar to Java's. In Java code, when I type a closing brace, that brace is automatically unindented to match the indentation level of it's parent block. How would I go about implementing this feature in my custom language? My formatter already formats it correctly, but when I actually type the character it stays at the indentation level for the contents of the block I just closed.

Or, even better, how would I implement automatic insertion of the closing brace when the opening brace is typed?

Thanks,
Gordon

2 comments

Have you Implemented/registered your own BraceMatcher?

0

Argh! Yes, I have. But I just discovered that I was using the incorrect token types. Copy & paste strikes again! :P

Thanks :)

0

Please sign in to leave a comment.