5 <title>CodeMirror: Match Highlighter Demo</title>
6 <link rel="stylesheet" href="../lib/codemirror.css">
7 <script src="../lib/codemirror.js"></script>
8 <script src="../addon/search/searchcursor.js"></script>
9 <script src="../addon/search/match-highlighter.js"></script>
10 <link rel="stylesheet" href="../doc/docs.css">
12 <style type="text/css">
13 .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
14 .CodeMirror-focused .cm-matchhighlight {
15 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
16 background-position: bottom;
17 background-repeat: repeat-x;
22 <h1>CodeMirror: Match Highlighter Demo</h1>
24 <form><textarea id="code" name="code">Select this text: hardToSpotVar
25 And everywhere else in your code where hardToSpotVar appears will automatically illuminate.
26 Give it a try! No more hardToSpotVars.</textarea></form>
29 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
31 highlightSelectionMatches: {showToken: /\w/}
35 <p>Search and highlight occurences of the selected text.</p>