Pass LinesYardstick to TextEditorPresenter

This commit is contained in:
Antonio Scandurra
2015-09-29 11:47:46 +02:00
parent b481250757
commit 40e5f264c5
2 changed files with 6 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ ScrollbarComponent = require './scrollbar-component'
ScrollbarCornerComponent = require './scrollbar-corner-component'
OverlayManager = require './overlay-manager'
DOMElementPool = require './dom-element-pool'
LinesYardstick = require './lines-yardstick'
module.exports =
class TextEditorComponent
@@ -85,6 +86,9 @@ class TextEditorComponent
@linesComponent = new LinesComponent({@presenter, @hostElement, @useShadowDOM, @domElementPool})
@scrollViewNode.appendChild(@linesComponent.getDomNode())
@linesYardstick = new LinesYardstick(@editor, @presenter, @linesComponent)
@presenter.setLinesYardstick(@linesYardstick)
@horizontalScrollbarComponent = new ScrollbarComponent({orientation: 'horizontal', onScroll: @onHorizontalScroll})
@scrollViewNode.appendChild(@horizontalScrollbarComponent.getDomNode())

View File

@@ -41,6 +41,8 @@ class TextEditorPresenter
@startReflowing() if @continuousReflow
@updating = false
setLinesYardstick: (@linesYardstick) ->
destroy: ->
@disposables.dispose()