Use Project::getPaths() and Project::setPaths()

This commit is contained in:
Ben Ogle 2014-11-25 15:25:07 -08:00
parent ffda2386c3
commit 6f82281b8f

View File

@ -31,9 +31,9 @@ class WindowEventHandler
@subscribe $(window), 'blur', -> document.body.classList.add('is-blurred')
@subscribeToCommand $(window), 'window:open-path', (event, {pathToOpen, initialLine, initialColumn}) ->
unless atom.project?.getPath()
unless atom.project?.getPaths().length
if fs.existsSync(pathToOpen) or fs.existsSync(path.dirname(pathToOpen))
atom.project?.setPath(pathToOpen)
atom.project?.setPaths([pathToOpen])
unless fs.isDirectorySync(pathToOpen)
atom.workspace?.open(pathToOpen, {initialLine, initialColumn})