         @editor.scrollToBufferPosition(oldRange.start)
         @addMarker oldRange.start.toArray()[0], data.colour
       else
+        if newRange.end.toArray()[0] > @editor.getLastBufferRow()
+          target = $('atom-text-editor#pusht::shadow .line-numbers')[0]
+          self = @
+          observer = new MutationObserver (mutations) ->
+            self.addMarker(newRange.end.toArray()[0], data.colour)
+            @disconnect()
+          config = {attributes: true, childList: true, characterData: true}
+          observer.observe(target, config)
+
         buffer.insert newRange.start, newText
         @editor.scrollToBufferPosition(newRange.start)
-        @addMarker newRange.start.toArray()[0], data.colour
+        # console.log($("atom-text-editor#pusht::shadow .line-number-1"))
+        # @addMarker(newRange.end.toArray()[0], data.colour)
+
 
       triggerPush = true
 

      @pairingChannel.trigger 'client-change', {deletion: deletion, event: event, colour: @markerColour}

    @editor.onDidChangeSelectionRange (event) =>
      # if @editor.getSelectedText() isnt ""
      # console.log event
      console.log(event.newBufferRange.isEqual(event.oldBufferRange))

      console.log event.oldBufferRange.serialize()
      console.log event.newBufferRange.serialize()

      rows = event.newBufferRange.getRows()
      @pairingChannel.trigger 'client-text-select', {colour: @markerColour, rows: rows}



  receiveFriendInfo: (data) ->
    friendInfo = {colour: data.colour}

    atom.views.getView(@editor).setAttribute('id', 'pusht')

    buffer = @buffer = @editor.buffer

    @pusher = new Pusher @app_key,
      authTransport: 'client'
