In org.gjt.sp.jedit.TextUtilities.findMatchingBracket gets a lot of stuff done, even when the current char is no bracket at all.
The patch is quite simple. If "c" is no bracket, return -1 straight away: this way a lot of token handling can get avoided - we would not find a matching bracket anyway.
--- org/gjt/sp/jedit/TextUtilities.java (Revision 9131)
+++ org/gjt/sp/jedit/TextUtilities.java (Arbeitskopie)
@@ -123,6 +123,11 @@
// corresponding character
char cprime = getComplementaryBracket(c,direction);
+ if( cprime == '\0' )
+ { // c is no bracket
+ return -1;
+ }
+
// 1 because we've already 'seen' the first bracket
int count = 1;
The same patch, as a file.
Logged In: YES
user_id=75113
Originator: NO
Applied, rev #9134.