 settings = require './settings'
 swrap = require './selection-wrapper'
 isSpecMode = atom.inSpecMode()
-
 lineHeight = null
 
 getCursorNode = (editorElement, cursor) ->


    cursors = cursorsToShow = @editor.getCursors()
    if submode is 'blockwise'
      cursorsToShow = @vimState.getBlockwiseSelections.map (bs) -> bs.getHead().cursor
    @subscriptions.add(@updateCursorStyle({submode, cursors, cursorsToShow})...)

  updateCursorStyle: ({submode, cursors, cursorsToShow}) ->
    for cursor in cursors
      if cursor in cursorsToShow
        cursor.setVisible(true) unless cursor.isVisible()

    # But corresponding cursorsComponent(HTML element) is added in sync.
    # So to modify style of cursorsComponent, we have to make sure corresponding cursorsComponent
    # is available by component in sync to model.
    @editorElement.component.updateSync() if submode is 'blockwise'

    # [FIXME] In spec mode, we skip here since not all spec have dom attached.
    return if isSpecMode

    for cursor in cursorsToShow
      cursorNode = getCursorNode(@editorElement, cursor)
      @subscriptions.add setStyle(cursorNode.style, getOffset(submode, cursor))

module.exports = CursorStyleManager
