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

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

Issue 2495723002: DevTools: [Sources] Make typing faster when search is open (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebInspector.SourcesTextEditor = class extends WebInspector.CodeMirrorTextEditor { 7 WebInspector.SourcesTextEditor = class extends WebInspector.CodeMirrorTextEditor {
8 /** 8 /**
9 * @param {!WebInspector.SourcesTextEditorDelegate} delegate 9 * @param {!WebInspector.SourcesTextEditorDelegate} delegate
10 */ 10 */
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 this._searchResultMarker.clear(); 788 this._searchResultMarker.clear();
789 delete this._searchResultMarker; 789 delete this._searchResultMarker;
790 } 790 }
791 if (this._highlightDescriptor && this._highlightDescriptor.selectionStart) 791 if (this._highlightDescriptor && this._highlightDescriptor.selectionStart)
792 this._codeMirror.removeLineClass(this._highlightDescriptor.selectionStart. line, 'wrap', 'cm-line-with-selection'); 792 this._codeMirror.removeLineClass(this._highlightDescriptor.selectionStart. line, 'wrap', 'cm-line-with-selection');
793 var selectionStart = this._highlightRange ? 793 var selectionStart = this._highlightRange ?
794 new CodeMirror.Pos(this._highlightRange.startLine, this._highlightRange. startColumn) : 794 new CodeMirror.Pos(this._highlightRange.startLine, this._highlightRange. startColumn) :
795 null; 795 null;
796 if (selectionStart) 796 if (selectionStart)
797 this._codeMirror.addLineClass(selectionStart.line, 'wrap', 'cm-line-with-s election'); 797 this._codeMirror.addLineClass(selectionStart.line, 'wrap', 'cm-line-with-s election');
798 if (this._highlightRegex === oldRegex) { 798 if (oldRegex && this._highlightRegex.toString() === oldRegex.toString()) {
799 // Do not re-add overlay mode if regex did not change for better performan ce. 799 // Do not re-add overlay mode if regex did not change for better performan ce.
800 if (this._highlightDescriptor) 800 if (this._highlightDescriptor)
801 this._highlightDescriptor.selectionStart = selectionStart; 801 this._highlightDescriptor.selectionStart = selectionStart;
802 } else { 802 } else {
803 this._removeHighlight(); 803 this._removeHighlight();
804 this._setHighlighter(this._searchHighlighter.bind(this, this._highlightReg ex), selectionStart); 804 this._setHighlighter(this._searchHighlighter.bind(this, this._highlightReg ex), selectionStart);
805 } 805 }
806 if (this._highlightRange) { 806 if (this._highlightRange) {
807 var pos = WebInspector.CodeMirrorUtils.toPos(this._highlightRange); 807 var pos = WebInspector.CodeMirrorUtils.toPos(this._highlightRange);
808 this._searchResultMarker = this._codeMirror.markText(pos.start, pos.end, { className: 'cm-column-with-selection'}); 808 this._searchResultMarker = this._codeMirror.markText(pos.start, pos.end, { className: 'cm-column-with-selection'});
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 */ 912 */
913 _setHighlighter(highlighter, selectionStart) { 913 _setHighlighter(highlighter, selectionStart) {
914 var overlayMode = {token: highlighter}; 914 var overlayMode = {token: highlighter};
915 this._codeMirror.addOverlay(overlayMode); 915 this._codeMirror.addOverlay(overlayMode);
916 this._highlightDescriptor = {overlay: overlayMode, selectionStart: selection Start}; 916 this._highlightDescriptor = {overlay: overlayMode, selectionStart: selection Start};
917 } 917 }
918 }; 918 };
919 919
920 WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; 920 WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000;
921 WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; 921 WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698