     newContent
 
   updateCursorElement: ->
-    return if not @element?
-    @element.style.outlined = not @focused
-    @element.style.inverse = @focused and @inversed
+
+    return  unless @element?
+
+    @element.style.outlined = !@focused
+    @element.style.inverse  =  @focused and @inversed
+
     @element.updateNode()
-
-

        @updateCursorElement()
      , 600

  addCursorElement: (content) ->
    return content if not @visible
    newContent = content.substring 0, @x
    newContent.merge = false
    @element = content.substring(@x, @x + 1).get(0) ? new StyledText(" ", @terminal.currentStyle)

    @terminal.screenBuffer.addLineToUpdate lastY if lastY < @terminal.sizeY and y isnt lastY
    @terminal.screenBuffer.addLineToUpdate y


  savePosition: ->
    @savedX = @x
    @savedY = @y


  restorePosition: ->
    @moveTo @savedX, @savedY


  setVisibility: (value) ->

    return  if @visible is value

    @visible = value
    @element = null
    
    @terminal.screenBuffer.addLineToUpdate @y


  setFocused: (value) ->
    return  if @focused is value or @stopped

    @focused = value
    @resetBlink()


  setBlinking: (blinking) ->
    @blinking = blinking
    @resetBlink()


  stopBlink: ->
    @stopped = true
    @resetBlink()


  resetBlink: ->

    if @blinkInterval?
      global.clearInterval @blinkInterval
      @blinkInterval = null

    @inversed = yes
    @updateCursorElement()
    if (@focused and not @stopped) and @blinking
      @blinkInterval = global.setInterval =>
