mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Size TextEditorElement according to the autoWidth property
This commit is contained in:
@@ -129,7 +129,7 @@ class TextEditorComponent
|
||||
updateSync: ->
|
||||
@updateSyncPreMeasurement()
|
||||
|
||||
@oldState ?= {}
|
||||
@oldState ?= {content: {}}
|
||||
@newState = @presenter.getPostMeasurementState()
|
||||
|
||||
if @editor.getLastSelection()? and not @editor.getLastSelection().isEmpty()
|
||||
@@ -149,6 +149,15 @@ class TextEditorComponent
|
||||
else
|
||||
@domNode.style.height = ''
|
||||
|
||||
if (@newState.content.autoWidth isnt @oldState.content.autoWidth) or (@newState.content.width isnt @oldState.content.width)
|
||||
if @newState.content.autoWidth
|
||||
@hostElement.style.width = @newState.content.width + 'px'
|
||||
else
|
||||
@hostElement.style.width = ''
|
||||
|
||||
@oldState.content.width = @newState.content.width
|
||||
@oldState.content.autoWidth = @newState.content.autoWidth
|
||||
|
||||
if @newState.gutters.length
|
||||
@mountGutterContainerComponent() unless @gutterContainerComponent?
|
||||
@gutterContainerComponent.updateSync(@newState)
|
||||
|
||||
Reference in New Issue
Block a user