| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.CodeMirrorTextEditor} | 7 * @extends {WebInspector.CodeMirrorTextEditor} |
| 8 * @param {!WebInspector.SourcesTextEditorDelegate} delegate | 8 * @param {!WebInspector.SourcesTextEditorDelegate} delegate |
| 9 */ | 9 */ |
| 10 WebInspector.SourcesTextEditor = function(delegate) | 10 WebInspector.SourcesTextEditor = function(delegate) |
| 11 { | 11 { |
| 12 WebInspector.CodeMirrorTextEditor.call(this); | 12 WebInspector.CodeMirrorTextEditor.call(this, { |
| 13 lineNumbers: true, |
| 14 lineWrapping: false, |
| 15 bracketMatchingSetting: WebInspector.moduleSetting("textEditorBracketMat
ching"), |
| 16 }); |
| 13 | 17 |
| 14 this.codeMirror().addKeyMap({ | 18 this.codeMirror().addKeyMap({ |
| 15 "Enter": "smartNewlineAndIndent", | 19 "Enter": "smartNewlineAndIndent", |
| 16 "Esc": "sourcesDismiss" | 20 "Esc": "sourcesDismiss" |
| 17 }); | 21 }); |
| 18 | 22 |
| 19 this._delegate = delegate; | 23 this._delegate = delegate; |
| 20 | 24 |
| 21 this.codeMirror().on("changes", this._changesForDelegate.bind(this)); | 25 this.codeMirror().on("changes", this._changesForDelegate.bind(this)); |
| 22 this.codeMirror().on("cursorActivity", this._cursorActivity.bind(this)); | 26 this.codeMirror().on("cursorActivity", this._cursorActivity.bind(this)); |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 this._codeMirror.addOverlay(overlayMode); | 975 this._codeMirror.addOverlay(overlayMode); |
| 972 this._highlightDescriptor = { | 976 this._highlightDescriptor = { |
| 973 overlay: overlayMode, | 977 overlay: overlayMode, |
| 974 selectionStart: selectionStart | 978 selectionStart: selectionStart |
| 975 }; | 979 }; |
| 976 } | 980 } |
| 977 } | 981 } |
| 978 | 982 |
| 979 WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; | 983 WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; |
| 980 WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; | 984 WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; |
| OLD | NEW |