We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebaccf6 commit aab9d71Copy full SHA for aab9d71
addon/search/match-highlighter.js
@@ -90,7 +90,7 @@
90
var state = cm.state.matchHighlighter;
91
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
92
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
93
- var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
+ var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[+*?(){|^$]/g, "\\$&") + "\\b") : query;
94
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
95
{className: "CodeMirror-selection-highlight-scrollbar"});
96
}
0 commit comments