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

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js

Issue 2772643002: DevTools: Changes View (Closed)
Patch Set: no highlighting Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
index 41d0d9ba36d49fce89744efb2f175f76520b572d..a5f3eba7e9216cfd3daa968aaae6f8066f32d5c2 100644
--- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
@@ -144,7 +144,10 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
this._codeMirror.setOption('flattenSpans', false);
- this._codeMirror.setOption('maxHighlightLength', TextEditor.CodeMirrorTextEditor.maxHighlightLength);
+ var maxHighlightLength = options.maxHighlightLength;
+ if (typeof maxHighlightLength !== 'number')
+ maxHighlightLength = TextEditor.CodeMirrorTextEditor.maxHighlightLength;
+ this._codeMirror.setOption('maxHighlightLength', maxHighlightLength);
this._codeMirror.setOption('mode', null);
this._codeMirror.setOption('crudeMeasuringFrom', 1000);
@@ -695,6 +698,14 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
}
/**
+ * @param {!Object} mode
+ */
+ setHighlightMode(mode) {
+ this._mimeType = '';
+ this._codeMirror.setOption('mode', mode);
+ }
+
+ /**
* @protected
* @param {string} mimeType
*/
@@ -731,6 +742,13 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
}
/**
+ * @param {function(number):string} formatter
+ */
+ setLineNumberFormatter(formatter) {
+ this._codeMirror.setOption('lineNumberFormatter', formatter);
+ }
+
+ /**
* @override
* @param {function(!KeyboardEvent)} handler
*/

Powered by Google App Engine
This is Rietveld 408576698