| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 SourceFrame.SourcesTextEditor = class extends TextEditor.CodeMirrorTextEditor { | 7 SourceFrame.SourcesTextEditor = class extends TextEditor.CodeMirrorTextEditor { |
| 8 /** | 8 /** |
| 9 * @param {!SourceFrame.SourcesTextEditorDelegate} delegate | 9 * @param {!SourceFrame.SourcesTextEditorDelegate} delegate |
| 10 */ | 10 */ |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 super.scrollToLine(lineNumber); | 110 super.scrollToLine(lineNumber); |
| 111 this._scroll(); | 111 this._scroll(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * @param {!RegExp} regex | 115 * @param {!RegExp} regex |
| 116 * @param {?Common.TextRange} range | 116 * @param {?Common.TextRange} range |
| 117 */ | 117 */ |
| 118 highlightSearchResults(regex, range) { | 118 highlightSearchResults(regex, range) { |
| 119 /** | 119 /** |
| 120 * @this {TextEditor.CodeMirrorTextEditor} | 120 * @this {SourceFrame.SourcesTextEditor} |
| 121 */ | 121 */ |
| 122 function innerHighlightRegex() { | 122 function innerHighlightRegex() { |
| 123 if (range) { | 123 if (range) { |
| 124 this.scrollLineIntoView(range.startLine); | 124 this.scrollLineIntoView(range.startLine); |
| 125 if (range.endColumn > TextEditor.CodeMirrorTextEditor.maxHighlightLength
) | 125 if (range.endColumn > TextEditor.CodeMirrorTextEditor.maxHighlightLength
) |
| 126 this.setSelection(range); | 126 this.setSelection(range); |
| 127 else | 127 else |
| 128 this.setSelection(Common.TextRange.createFromLocation(range.startLine,
range.startColumn)); | 128 this.setSelection(Common.TextRange.createFromLocation(range.startLine,
range.startColumn)); |
| 129 } | 129 } |
| 130 this._tokenHighlighter.highlightSearchResults(regex, range); | 130 this._tokenHighlighter.highlightSearchResults(regex, range); |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 */ | 871 */ |
| 872 _setHighlighter(highlighter, selectionStart) { | 872 _setHighlighter(highlighter, selectionStart) { |
| 873 var overlayMode = {token: highlighter}; | 873 var overlayMode = {token: highlighter}; |
| 874 this._codeMirror.addOverlay(overlayMode); | 874 this._codeMirror.addOverlay(overlayMode); |
| 875 this._highlightDescriptor = {overlay: overlayMode, selectionStart: selection
Start}; | 875 this._highlightDescriptor = {overlay: overlayMode, selectionStart: selection
Start}; |
| 876 } | 876 } |
| 877 }; | 877 }; |
| 878 | 878 |
| 879 SourceFrame.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; | 879 SourceFrame.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; |
| 880 SourceFrame.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; | 880 SourceFrame.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; |
| OLD | NEW |