Remove presenter as a dependency where possible

Although we have a couple of components which still access it, we
agreed it would have been just better to avoid relying on
`TextEditorPresenter` where possible and use it purposefully in other
places (e.g. `LinesComponent` which needs it to store text
measurements).

/cc: @jssln
This commit is contained in:
Antonio Scandurra
2015-06-13 14:18:36 +02:00
parent b6049857ed
commit e893b5105b
6 changed files with 33 additions and 31 deletions

View File

@@ -14,7 +14,7 @@ class LinesComponent extends TiledComponent
@domNode = document.createElement('div')
@domNode.classList.add('lines')
@cursorsComponent = new CursorsComponent(@presenter)
@cursorsComponent = new CursorsComponent
@domNode.appendChild(@cursorsComponent.getDomNode())
if @useShadowDOM
@@ -95,8 +95,3 @@ class LinesComponent extends TiledComponent
component.clearMeasurements()
@presenter.clearScopedCharacterWidths()
lineNodeForScreenRow: (screenRow) ->
tile = @presenter.tileForRow(screenRow)
@componentsByTileId[tile]?.lineNodeForScreenRow(screenRow)