Issue 1407280: ParenMatch: workaround for misinterpreting of closing parens (original) (raw)
ParenMatch sometimes misinterprets closing parenthesis because it is given a bad keysym. The real bug is probably somewhere in the event handling mechanism or something.
Somehow the text widget gets the right signal and the appropriate closing paren is written there.
This simple patch checks the last inserted character in the text widget insted of the generated keysym, and acts accordingly.
Since the function where the workaround is applied reads text from the text widget from the same index anyways, I think this workaround is actually much cleaner than checking the keysym!
Works like a charm on my Python2.4 WinXP installation.