 
 # note: this isn't called when switching between files
 Template.fileEdit.destroyed = ->
-  console.log 'destroyed'
   if GitRt.cm
     $(GitRt.cm.getWrapperElement()).remove()
     delete GitRt.cm


Deps.autorun ->
  fileInfo = FileInfo.findOne()
  console.log ['autorun fileInfo', fileInfo]
  if fileInfo
    # TODO is GitRt.cm guaranteed to be set here? looks like no
    try

      operations = FileOperations.find(
        {_id: {$gt: lastRevision}}, sort: {_id: 1})
      operations.forEach (operation) ->
        lastRevision = operation._id
        if operation.clientId != fileInfo.clientId
          serverAdapter.trigger('operation', operation.operation)
