Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| index 8b6730246bfd24ec7e530708cf48f232c02e88e4..b26cadd1f6ecc6e011fe58895da2945d727fbcdd 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| @@ -39,6 +39,8 @@ WebInspector.CodeMirrorTextEditor = function(url, delegate) |
| WebInspector.VBox.call(this); |
| this._delegate = delegate; |
| this._url = url; |
| + /** @type {!Set<number>}} */ |
| + this._gutterMarkers = new Set(); |
| this.registerRequiredCSS("cm/codemirror.css"); |
| this.registerRequiredCSS("source_frame/cmdevtools.css"); |
| @@ -1118,6 +1120,29 @@ WebInspector.CodeMirrorTextEditor.prototype = { |
| /** |
| * @param {number} lineNumber |
| + * @param {string} type |
| + * @param {?Element} element |
| + */ |
| + setGutterMarker: function(lineNumber, type, element) |
| + { |
| + if (element) { |
| + if (!this._gutterMarkers.size) { |
| + this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers", "CodeMirror-linemarkers-" + type]); |
| + this._codeMirror.refresh(); |
| + } |
| + this._gutterMarkers.add(lineNumber); |
| + } else { |
| + this._gutterMarkers.delete(lineNumber); |
| + if (!this._gutterMarkers.size) { |
| + this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers"]); |
| + this._codeMirror.refresh(); |
| + } |
| + } |
| + this._codeMirror.setGutterMarker(lineNumber, "CodeMirror-linemarkers-" + type, element); |
|
pfeldman
2016/03/07 19:57:50
Throttle using operation?
alph
2016/03/08 00:57:42
It's already wrapped inside CM.
|
| + }, |
| + |
| + /** |
| + * @param {number} lineNumber |
| * @param {number} columnNumber |
| */ |
| setExecutionLocation: function(lineNumber, columnNumber) |