Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js

Issue 2778873003: DevTools: Convert TextEditor from Interface to Abstract class (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698