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?


Comment actions Permalink

Have you Implemented/registered your own BraceMatcher?

Comment actions Permalink

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

Thanks :)


Please sign in to leave a comment.