     @foldsByMarkerId = {}
     @decorationsById = {}
     @decorationsByMarkerId = {}
-    @updateAllScreenLines()
-    @createFoldForMarker(marker) for marker in @buffer.findMarkers(@getFoldMarkerAttributes())
     @subscribe @tokenizedBuffer.observeGrammar @subscribeToScopedConfigSettings
     @subscribe @tokenizedBuffer.onDidChange @handleTokenizedBufferChange
     @subscribe @buffer.onDidUpdateMarkers @handleBufferMarkersUpdated
     @subscribe @buffer.onDidCreateMarker @handleBufferMarkerCreated
-
     @updateAllScreenLines()
+    @createFoldForMarker(marker) for marker in @buffer.findMarkers(@getFoldMarkerAttributes())
 
   subscribeToScopedConfigSettings: =>
     @scopedConfigSubscriptions?.dispose()

      @isSoftWrapped()

  isSoftWrapped: ->
    @softWrapped ? atom.config.get(@getRootScopeDescriptor(), 'editor.softWrap') ? false

  # Set the number of characters that fit horizontally in the editor.
  #


    scopeDescriptor = @getRootScopeDescriptor()

    oldConfigSettings = @configSettings
    @configSettings =
      scrollPastEnd: atom.config.get(scopeDescriptor, 'editor.scrollPastEnd')
      softWrap: atom.config.get(scopeDescriptor, 'editor.softWrap')
      softWrapAtPreferredLineLength: atom.config.get(scopeDescriptor, 'editor.softWrapAtPreferredLineLength')
      preferredLineLength: atom.config.get(scopeDescriptor, 'editor.preferredLineLength')

    subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.softWrap', ({newValue}) =>
      @configSettings.softWrap = newValue
      @updateWrappedScreenLines()

    subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.softWrapAtPreferredLineLength', ({newValue}) =>
      @configSettings.softWrapAtPreferredLineLength = newValue
      @updateWrappedScreenLines() if @isSoftWrapped()

    subscriptions.add atom.config.onDidChange scopeDescriptor, 'editor.preferredLineLength', ({newValue}) =>
      @configSettings.preferredLineLength = newValue
      @updateWrappedScreenLines() if @isSoftWrapped() and atom.config.get(scopeDescriptor, 'editor.softWrapAtPreferredLineLength')

    subscriptions.add atom.config.observe scopeDescriptor, 'editor.scrollPastEnd', (value) =>
      @configSettings.scrollPastEnd = value

    @updateWrappedScreenLines() if oldConfigSettings? and not _.isEqual(oldConfigSettings, @configSettings)

  serializeParams: ->
    id: @id
