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 4f27a0a3805a1d69bb03aaf5dbc67c65481c5507..ad20610c0064b8d5666d888fb959aa45e29ec7d5 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 |
@@ -162,6 +162,8 @@ WebInspector.CodeMirrorTextEditor = function(options) |
this.element.tabIndex = 0; |
if (options.mimeType) |
this.setMimeType(options.mimeType); |
+ if (options.autoHeight) |
+ this._codeMirror.setSize(null, "auto"); |
} |
WebInspector.CodeMirrorTextEditor.maxHighlightLength = 1000; |
@@ -979,8 +981,12 @@ WebInspector.CodeMirrorTextEditor.prototype = { |
var scrollTop = this._codeMirror.doc.scrollTop; |
var width = parentElement.offsetWidth; |
var height = parentElement.offsetHeight - this.element.offsetTop; |
- this._codeMirror.setSize(width, height); |
- this._updatePaddingBottom(width, height); |
+ if (this._options.autoHeight) { |
+ this._codeMirror.setSize(width, "auto"); |
+ } else { |
+ this._codeMirror.setSize(width, height); |
+ this._updatePaddingBottom(width, height); |
+ } |
this._codeMirror.scrollTo(scrollLeft, scrollTop); |
}, |