 
     verticalScrollbarVisible =
       @contentHeight > clientHeightWithoutHorizontalScrollbar or
-        @contentHeight > clientHeightWithHorizontalScrollbar and contentWidth > clientWidthWithoutVerticalScrollbar
+        @contentHeight > clientHeightWithHorizontalScrollbar and @contentWidth > clientWidthWithoutVerticalScrollbar
 
     if verticalScrollbarVisible
       @verticalScrollbarWidth

      contentHeight += extraScrollHeight if extraScrollHeight > 0
    Math.max(contentHeight, @height)

  computeContentWidth: ->
    contentWidth = @pixelPositionForScreenPosition([@model.getLongestScreenRow(), Infinity]).left
    contentWidth += 1 unless @model.isSoftWrapped() # account for cursor width
    contentWidth

  updateContentHeight: ->
    @contentHeight = @lineHeight * @model.getScreenLineCount()

    @characterWidthsChanged() unless @batchingCharacterMeasurement

  characterWidthsChanged: ->
    @updateContentWidth()

    @updateHorizontalScrollState()
    @updateContentState()
    @updateDecorations()
