     @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
+
+    return  if @visible is value
+
     @visible = value
     @element = null
+    
     @terminal.screenBuffer.addLineToUpdate @y
 
+
   setFocused: (value) ->
-    return if @focused is value or @stopped
+    return  if @focused is value or @stopped
+
     @focused = value
     @resetBlink()
 
-  setBlinking: (@blinking) -> @resetBlink()
+
+  setBlinking: (blinking) ->
+    @blinking = blinking
+    @resetBlink()
+
 
   stopBlink: ->
     @stopped = true
     @resetBlink()
 
+
   resetBlink: ->
+
     if @blinkInterval?
       global.clearInterval @blinkInterval
       @blinkInterval = null
-    @inversed = true
+
+    @inversed = yes
     @updateCursorElement()
     if (@focused and not @stopped) and @blinking
       @blinkInterval = global.setInterval =>



module.exports = class Cursor
  constructor: (@terminal) ->
    @x = 0
    @y = 0
    @element = null
    @inversed = true
    @visible = true
    @focused = true
    @blinkInterval = null
    @savedX = 0
    @savedY = 0
    @resetBlink()

  move: (x, y) ->
    @moveTo @x + x, @y + y

  moveTo: (x, y) ->
    x = Math.max x, 0

    newContent

  updateCursorElement: ->

    return  unless @element?

    @element.style.outlined = !@focused
    @element.style.inverse  =  @focused and @inversed

    @element.updateNode()
