         add pad(c.source, ws) + pad(c.comment, wc) + pad(c.total, wt) + '  ' + label
       null
 
+    rootDirPath = atom.project.getDirectories()[0].getPath()
+    editor = atom.workspace.getActiveTextEditor()
+    if editor and editor.getPath()
+      rootDirPath = path.dirname(editor.getPath())
+      console.log rootDirPath
+
     atom.workspace.open('line-count.txt').then (editor) =>
-      rootDirPath = atom.project.getDirectories()[0].getPath()
-
       files    = {}
       typeData = {}
       dirs     = {}

  "svg"
  "swift"
  "ts"
  "vb"
  "vue"
  "xml"

sloc       = require 'sloc'
filewalker = require 'filewalker'
parser     = require 'gitignore-parser'
path       = require 'path'

suffixes = [
  "asm"
