File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,16 @@ export class BracketTokens {
98
98
}
99
99
100
100
function prepareBracketForRegExp ( str : string ) : string {
101
- const escaped = escapeRegExpCharacters ( str ) ;
102
- // This bracket pair uses letters like e.g. "begin" - "end" (see https://github.com/microsoft/vscode/issues/132162)
103
- const needsWordBoundaries = ( / ^ [ \w ] + $ / . test ( str ) ) ;
104
- return ( needsWordBoundaries ? `\\b${ escaped } \\b` : escaped ) ;
101
+ let escaped = escapeRegExpCharacters ( str ) ;
102
+ // These bracket pair delimiters start or end with letters
103
+ // see https://github.com/microsoft/vscode/issues/132162 https://github.com/microsoft/vscode/issues/150440
104
+ if ( / ^ [ \w ] + / . test ( str ) ) {
105
+ escaped = `\\b${ escaped } ` ;
106
+ }
107
+ if ( / [ \w ] + $ / . test ( str ) ) {
108
+ escaped = `${ escaped } \\b` ;
109
+ }
110
+ return escaped ;
105
111
}
106
112
107
113
export class LanguageAgnosticBracketTokens {
You can’t perform that action at this time.
0 commit comments