| 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..f0f6779bf6d9be6724c1ebedf8a1c0b1a281da4f 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
|
| @@ -1050,6 +1050,26 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
|
|
|
| this._decorations.valuesArray().forEach(decoration => this._codeMirror.removeLineWidget(decoration.widget));
|
| this._decorations.clear();
|
| +
|
| + if (this._muteTextChangedEvent)
|
| + return;
|
| +
|
| + var edits = [];
|
| + var currentEdit;
|
| +
|
| + for (var changeIndex = 0; changeIndex < changes.length; ++changeIndex) {
|
| + var changeObject = changes[changeIndex];
|
| + var edit = TextEditor.CodeMirrorUtils.changeObjectToEditOperation(changeObject);
|
| + if (currentEdit && edit.oldRange.equal(currentEdit.newRange)) {
|
| + currentEdit.newRange = edit.newRange;
|
| + } else {
|
| + currentEdit = edit;
|
| + edits.push(currentEdit);
|
| + }
|
| + }
|
| +
|
| + for (var i = 0; i < edits.length; i++)
|
| + this.emit(new UI.TextEditor.TextChangedEvent(edits[i].oldRange, edits[i].newRange));
|
| }
|
|
|
| /**
|
| @@ -1169,6 +1189,7 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
|
| * @param {string} text
|
| */
|
| setText(text) {
|
| + this._muteTextChangedEvent = true;
|
| if (text.length > TextEditor.CodeMirrorTextEditor.MaxEditableTextSize) {
|
| this.configureAutocomplete(null);
|
| this.setReadOnly(true);
|
| @@ -1184,6 +1205,7 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
|
| this._enableLongLinesMode();
|
| else
|
| this._disableLongLinesMode();
|
| + delete this._muteTextChangedEvent;
|
| }
|
|
|
| /**
|
|
|