 		if @isScratchOpen()
 			@closeScratch()
 		else
-			atom.workspace.open(atom.getConfigDirPath() + "/scratch")
+			atom.workspace.open(@dirPath + "/" + @fileName)
 
 	isScratchOpen: ->
 		editors = atom.workspace.getEditors()
 		for editor in editors
-			return true if editor.getTitle() is "scratch"
+			return true if editor.getTitle() is @fileName
 		return false
 
 	closeScratch: ->

		scratch = null
		for editor in editors
			do (editor) ->
				if editor.getTitle() is "scratch"
					scratch = editor
		if scratch
			scratch.shouldPromptToSave
			atom.workspace.getActivePane().promptToSaveItem(scratch)
		editor.destroy()

module.exports =

	dirPath: atom.getConfigDirPath()
	fileName: "scratch"

	activate: (state) ->
		atom.workspaceView.command "scratch:toggle", => @toggleScratch()
