       @verticalScrollbarContent.height(@layerHeight)
       @scrollBottom(height) if @scrollBottom() > height
 
-    minWidth = Math.max(@charWidth * @editor.getMaxScreenLineLength() + 20, @scrollView.width())
+    minWidth = Math.max(@charWidth * @editor.getMaxScreenLineLength() + 20, scrollViewWidth)
     unless @layerMinWidth == minWidth
       @renderedLines.css('min-width', minWidth)
       @underlayer.css('min-width', minWidth)

      else
        @underlayer.append($('<span/>', class: 'placeholder-text', text: @placeholderText))

  updateRenderedLines: ->
    firstVisibleScreenRow = @getFirstVisibleScreenRow()
    lastScreenRowToRender = firstVisibleScreenRow + @heightInLines - 1
    lastScreenRow = @editor.getLastScreenRow()

      @clearCharacterWidthCache()
      @requestDisplayUpdate()

  updateLayerDimensions: (scrollViewWidth) ->
    height = @lineHeight * @editor.getScreenLineCount()
    unless @layerHeight == height
      @layerHeight = height
