diff --git a/src/app/atom.coffee b/src/app/atom.coffee index ded8ab01a..d3001ce72 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -17,6 +17,13 @@ window.atom = getPathToOpen: -> window.location.params.pathToOpen + setPathToOpen: (pathToOpen) -> + window.location.params.pathToOpen = pathToOpen + hashSegments = [] + for name, value of window.location.params + hashSegments.push("#{encodeURIComponent(name)}=#{encodeURIComponent(value)}") + window.location.hash = '#' + hashSegments.join('&') + getPackageState: (name) -> @packageStates[name] diff --git a/src/app/window.coffee b/src/app/window.coffee index 1570b82d9..e1fa70343 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -128,8 +128,11 @@ window.deserializeEditorWindow = -> window.git = Git.open(project.getPath()) project.on 'path-changed', -> + projectPath = project.getPath() + atom.setPathToOpen(projectPath) + window.git?.destroy() - window.git = Git.open(project.getPath()) + window.git = Git.open(projectPath) window.deserializeConfigWindow = -> ConfigView = require 'config-view' diff --git a/src/atom-window.coffee b/src/atom-window.coffee index 155a84221..19a27e8d8 100644 --- a/src/atom-window.coffee +++ b/src/atom-window.coffee @@ -12,7 +12,7 @@ class AtomWindow @browserWindow = new BrowserWindow show: false, title: 'Atom' @handleEvents() - url = "file://#{resourcePath}/static/index.html?bootstrapScript=#{bootstrapScript}&resourcePath=#{resourcePath}" + url = "file://#{resourcePath}/static/index.html#bootstrapScript=#{bootstrapScript}&resourcePath=#{resourcePath}" url += "&pathToOpen=#{@pathToOpen}" if @pathToOpen url += '&exitWhenDone=1' if exitWhenDone diff --git a/static/index.html b/static/index.html index 538cdd566..a8e6ee671 100644 --- a/static/index.html +++ b/static/index.html @@ -5,13 +5,13 @@