How come BraceMatch() doesn't work when a lexer is set in wxStyledTextCtrl?
- by George Edison
I have the following chunk of C++ code that gets called when } is pressed:
int iCurPos = GetCurrentPos();
InsertText(iCurPos,wxT("}"));
int iPos = BraceMatch(iCurPos);
This works fine (iPos gets the position of the matching brace) except when I call SetLexer(...) beforehand. Then it returns -1? How can I get it to work?
Edit: I should point out that the above code is being called from the EVT_KEY_DOWN handler in a wxStyledTextCtrl-derived class.