Skip to content

Commit

Permalink
Highlight occurences of the selected text
Browse files Browse the repository at this point in the history
Search and highlight occurrences of the selected text.
  • Loading branch information
csordasmarton committed Apr 12, 2018
1 parent 6984fbb commit e85c57b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<script type="text/javascript" src="scripts/plugins/codemirror/dist/codemirror.min.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/mode/clike/clike.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/dialog/dialog.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/scroll/annotatescrollbar.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/search/match-highlighter.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/search/matchesonscrollbar.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/search/search.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/search/searchcursor.js"></script>
<script type="text/javascript" src="scripts/plugins/codemirror/addon/edit/matchbrackets.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion www/scripts/codecheckerviewer/BugViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ function (declare, domClass, dom, style, fx, Toggler, keys, on, query, Memory,
foldGutter : true,
gutters : ['CodeMirror-linenumbers', 'bugInfo'],
extraKeys : {},
viewportMargin : 500
viewportMargin : 500,
highlightSelectionMatches : { showToken: /\w/, annotateScrollbar: true }
});

this.codeMirror.on('viewportChange', function (cm, from, to) {
Expand Down
8 changes: 8 additions & 0 deletions www/style/codecheckerviewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,11 @@ html, body {
.dijitTooltip .bug-path-length {
padding: 0px 4px;
}

.cm-matchhighlight {
background-color: lightgreen
}

.CodeMirror-selection-highlight-scrollbar {
background-color: green
}

0 comments on commit e85c57b

Please sign in to comment.