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

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

Issue 2490273003: DevTools: [Sources] Speed up editor tab opening (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a21d2074e4aa56afc68dd414cb906d862de6d29..8e3f3f7151e2dd4a8670b047a0bca1767650f690 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
@@ -863,17 +863,19 @@ WebInspector.CodeMirrorTextEditor = class extends WebInspector.VBox {
var parentElement = this.element.parentElement;
if (!parentElement || !this.isShowing())
return;
- var scrollLeft = this._codeMirror.doc.scrollLeft;
- var scrollTop = this._codeMirror.doc.scrollTop;
- var width = parentElement.offsetWidth;
- var height = parentElement.offsetHeight - this.element.offsetTop;
- if (this._options.autoHeight) {
- this._codeMirror.setSize(width, 'auto');
- } else {
- this._codeMirror.setSize(width, height);
- this._updatePaddingBottom(width, height);
- }
- this._codeMirror.scrollTo(scrollLeft, scrollTop);
+ this._codeMirror.operation(() => {
+ var scrollLeft = this._codeMirror.doc.scrollLeft;
+ var scrollTop = this._codeMirror.doc.scrollTop;
+ var width = parentElement.offsetWidth;
+ var height = parentElement.offsetHeight - this.element.offsetTop;
+ if (this._options.autoHeight) {
+ this._codeMirror.setSize(width, 'auto');
+ } else {
+ this._codeMirror.setSize(width, height);
+ this._updatePaddingBottom(width, height);
+ }
+ this._codeMirror.scrollTo(scrollLeft, scrollTop);
+ });
}
/**
« 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