高亮所有当前选中元素

This commit is contained in:
Liang Ding 2014-09-06 21:24:28 +08:00
parent ba3e91a6eb
commit 9f949f0ff4
3 changed files with 17 additions and 3 deletions

View File

@ -125,6 +125,12 @@ ul {
background-color: #D7D7D7; background-color: #D7D7D7;
width: 100% width: 100%
} }
.CodeMirror-focused .cm-matchhighlight {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
background-position: bottom;
background-repeat: repeat-x;
}
/* end editor */ /* end editor */
/* start output */ /* start output */

View File

@ -173,8 +173,13 @@ var editors = {
content: '<textarea id="editor' + id + '"></textarea>' content: '<textarea id="editor' + id + '"></textarea>'
}); });
rulers = [];
rulers.push({color: "#ccc", column: 120, lineStyle: "dashed"});
var editor = CodeMirror.fromTextArea(document.getElementById("editor" + id), { var editor = CodeMirror.fromTextArea(document.getElementById("editor" + id), {
lineNumbers: true, lineNumbers: true,
highlightSelectionMatches: {showToken: /\w/},
rulers: rulers,
styleActiveLine: true, styleActiveLine: true,
theme: 'lesser-dark', theme: 'lesser-dark',
indentUnit: 4, indentUnit: 4,

View File

@ -97,6 +97,9 @@
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/anyword-hint.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/anyword-hint.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/rulers.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/searchcursor.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/match-highlighter.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/go/go.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/go/go.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/xml/xml.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/xml/xml.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/htmlmixed/htmlmixed.js"></script> <script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/htmlmixed/htmlmixed.js"></script>