From e6026a145cf1cc5fc4e2d4e08b6bc0cd7cc6a8f4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 18 Mar 2017 20:08:08 -0700 Subject: [PATCH] Fix auto-width --- src/text-editor-component.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 5c11102db..3b09ba7d1 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -1537,6 +1537,8 @@ class TextEditorComponent { getContentWidth () { if (this.props.model.isSoftWrapped()) { return this.getClientWidth() - this.getGutterContainerWidth() + } else if (this.props.model.getAutoWidth()) { + return Math.round(this.measurements.longestLineWidth + this.measurements.baseCharacterWidth) } else { return Math.max( Math.round(this.measurements.longestLineWidth + this.measurements.baseCharacterWidth),