           statusBarIcon?.setTitle('Last heartbeat sent ' + formatDate(today))
       )
       lastHeartbeat = time
-      lastFile = file.path
+      lastFile = filePath
 
 fileIsIgnored = (file) ->
   if endsWith(file, 'COMMIT_EDITMSG') or endsWith(file, 'PULLREQ_EDITMSG') or endsWith(file, 'MERGE_MSG') or endsWith(file, 'TAG_EDITMSG')

        callback()

sendHeartbeat = (file, lineno, isWrite) ->
  if not file.path? or file.path is undefined
    log.debug 'Skipping file because path does not exist: ' + file.path
    return
  if fileIsIgnored(file.path)
    log.debug 'Skipping file because path matches ignore pattern: ' + file.path
    return

  time = Date.now()
  currentFile = file.path
  if isWrite or enoughTimePassed(time) or lastFile isnt currentFile
    pythonLocation (python) ->
      return unless python?

      args.push('--config')
      args.push(path.join getUserHome(), '.wakatime.cfg')

      if atom.project.contains(filePath)
        currentFile = filePath
        for rootDir in atom.project.rootDirectories
          realPath = rootDir.realPath
          if currentFile.indexOf(realPath) > -1
