     @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()


    scopeDescriptor = @getRootScopeDescriptor()

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

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

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

  serializeParams: ->
    id: @id

    return 0 unless lineHeight > 0

    scrollHeight = @getLineCount() * lineHeight
    if @height? and @configSettings.scrollPastEnd
      scrollHeight = scrollHeight + @height - (lineHeight * 3)

    scrollHeight
