OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 }; | 128 }; |
129 | 129 |
130 WebInspector.settings.textEditorIndent.addChangeListener(this._updateEditorI
ndentation, this); | 130 WebInspector.settings.textEditorIndent.addChangeListener(this._updateEditorI
ndentation, this); |
131 this._updateEditorIndentation(); | 131 this._updateEditorIndentation(); |
132 WebInspector.settings.showWhitespacesInEditor.addChangeListener(this._update
CodeMirrorMode, this); | 132 WebInspector.settings.showWhitespacesInEditor.addChangeListener(this._update
CodeMirrorMode, this); |
133 | 133 |
134 this._codeMirror.setOption("keyMap", WebInspector.isMac() ? "devtools-mac" :
"devtools-pc"); | 134 this._codeMirror.setOption("keyMap", WebInspector.isMac() ? "devtools-mac" :
"devtools-pc"); |
135 this._codeMirror.setOption("flattenSpans", false); | 135 this._codeMirror.setOption("flattenSpans", false); |
136 this._codeMirror.setOption("maxHighlightLength", 1000); | 136 this._codeMirror.setOption("maxHighlightLength", 1000); |
137 this._codeMirror.setOption("mode", null); | 137 this._codeMirror.setOption("mode", null); |
| 138 this._codeMirror.setOption("crudeMeasuringFrom", 1000); |
138 | 139 |
139 this._shouldClearHistory = true; | 140 this._shouldClearHistory = true; |
140 this._lineSeparator = "\n"; | 141 this._lineSeparator = "\n"; |
141 | 142 |
142 this._tokenHighlighter = new WebInspector.CodeMirrorTextEditor.TokenHighligh
ter(this._codeMirror); | 143 this._tokenHighlighter = new WebInspector.CodeMirrorTextEditor.TokenHighligh
ter(this._codeMirror); |
143 this._blockIndentController = new WebInspector.CodeMirrorTextEditor.BlockInd
entController(this._codeMirror); | 144 this._blockIndentController = new WebInspector.CodeMirrorTextEditor.BlockInd
entController(this._codeMirror); |
144 this._fixWordMovement = new WebInspector.CodeMirrorTextEditor.FixWordMovemen
t(this._codeMirror); | 145 this._fixWordMovement = new WebInspector.CodeMirrorTextEditor.FixWordMovemen
t(this._codeMirror); |
145 this._autocompleteController = new WebInspector.CodeMirrorTextEditor.Autocom
pleteController(this, this._codeMirror); | 146 this._autocompleteController = new WebInspector.CodeMirrorTextEditor.Autocom
pleteController(this, this._codeMirror); |
146 | 147 |
147 this._codeMirror.on("change", this._change.bind(this)); | 148 this._codeMirror.on("change", this._change.bind(this)); |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 * @param {number} line | 1552 * @param {number} line |
1552 * @param {number} column | 1553 * @param {number} column |
1553 * @return {AnchorBox} | 1554 * @return {AnchorBox} |
1554 */ | 1555 */ |
1555 _anchorBoxForPosition: function(line, column) | 1556 _anchorBoxForPosition: function(line, column) |
1556 { | 1557 { |
1557 var metrics = this._textEditor.cursorPositionToCoordinates(line, column)
; | 1558 var metrics = this._textEditor.cursorPositionToCoordinates(line, column)
; |
1558 return metrics ? new AnchorBox(metrics.x, metrics.y, 0, metrics.height)
: null; | 1559 return metrics ? new AnchorBox(metrics.x, metrics.y, 0, metrics.height)
: null; |
1559 }, | 1560 }, |
1560 } | 1561 } |
OLD | NEW |