Fix word boundary in the custom highlights regex not matching unicode

Fixes #1939
This commit is contained in:
Alistair McKinlay 2018-06-10 09:27:11 +01:00
parent b7072c8955
commit 3cd8ce6514

View File

@ -146,7 +146,7 @@ function applySetting(name, value) {
}); });
if (highlightsTokens && highlightsTokens.length) { if (highlightsTokens && highlightsTokens.length) {
module.exports.highlightsRE = new RegExp("\\b(?:" + highlightsTokens.join("|") + ")\\b", "i"); module.exports.highlightsRE = new RegExp(`(?:^| |\t)(?:${highlightsTokens.join("|")})(?:\t| |$)`, "i");
} else { } else {
module.exports.highlightsRE = null; module.exports.highlightsRE = null;
} }