From a4e1ab55f03b01c97640998d3746656f7c74b5d8 Mon Sep 17 00:00:00 2001 From: dgeorge Date: Fri, 11 Nov 2011 09:24:08 -0800 Subject: [PATCH] Changed the typeRe regular expression to be more strict. --- lib/ace/edit_session/bracket_match.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index d936296f..cc634b5a 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -82,8 +82,8 @@ function BracketMatch() { // matches any token containing the same identifiers or a subset. In // addition, if token.type includes "rparen", then also match "lparen". // So if type.token is "paren.rparen", then typeRe will match "lparen.paren". - var typeRe = new RegExp("(\\.?[" + - token.type.replace(".", "|").replace("rparen", "lparen|rparen") + "])+"); + var typeRe = new RegExp("(\\.?" + + token.type.replace(".", "|").replace("rparen", "lparen|rparen") + ")+"); // Start searching in token, just before the character at position.column var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; @@ -135,8 +135,8 @@ function BracketMatch() { // matches any token containing the same identifiers or a subset. In // addition, if token.type includes "lparen", then also match "rparen". // So if type.token is "lparen.paren", then typeRe will match "paren.rparen". - var typeRe = new RegExp("(\\.?[" + - token.type.replace(".", "|").replace("lparen", "lparen|rparen") + "])+"); + var typeRe = new RegExp("(\\.?" + + token.type.replace(".", "|").replace("lparen", "lparen|rparen") + ")+"); // Start searching in token, after the character at position.column var valueIndex = position.column - iterator.getCurrentTokenColumn();