mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Include remote paths, but skip normalization in the save/restore execution flow
This commit is contained in:
@@ -763,8 +763,7 @@ class Atom extends Model
|
||||
# Notify the browser project of the window's current project path
|
||||
watchProjectPath: ->
|
||||
@disposables.add @project.onDidChangePaths =>
|
||||
@constructor.updateLoadSetting('initialPaths',
|
||||
@project.getPaths().filter((projectPath) -> fs.existsSync(projectPath)))
|
||||
@constructor.updateLoadSetting('initialPaths', @project.getPaths())
|
||||
|
||||
exit: (status) ->
|
||||
app = remote.require('app')
|
||||
|
||||
@@ -369,7 +369,12 @@ class AtomApplication
|
||||
# :windowDimensions - Object with height and width keys.
|
||||
# :window - {AtomWindow} to open file paths in.
|
||||
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, windowDimensions, profileStartup, window}={}) ->
|
||||
pathsToOpen = (fs.normalize(pathToOpen) for pathToOpen in pathsToOpen)
|
||||
pathsToOpen = pathsToOpen.map (pathToOpen) ->
|
||||
if fs.existsSync(pathToOpen)
|
||||
fs.normalize(pathToOpen)
|
||||
else
|
||||
pathToOpen
|
||||
|
||||
locationsToOpen = (@locationForPathToOpen(pathToOpen) for pathToOpen in pathsToOpen)
|
||||
|
||||
unless pidToKillWhenClosed or newWindow
|
||||
@@ -517,6 +522,8 @@ class AtomApplication
|
||||
new AtomWindow({bootstrapScript, @resourcePath, exitWhenDone, isSpec, specDirectory, devMode})
|
||||
|
||||
locationForPathToOpen: (pathToOpen) ->
|
||||
{protocol} = url.parse(pathToOpen)
|
||||
return {pathToOpen} if protocol?
|
||||
return {pathToOpen} unless pathToOpen
|
||||
return {pathToOpen} if fs.existsSync(pathToOpen)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{Directory} = require 'pathwatcher'
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
url = require 'url'
|
||||
|
||||
module.exports =
|
||||
class DefaultDirectoryProvider
|
||||
@@ -21,7 +22,13 @@ class DefaultDirectoryProvider
|
||||
else
|
||||
projectPath
|
||||
|
||||
new Directory(directoryPath)
|
||||
# TODO: Stop normalizing the path in pathwatcher's Directory.
|
||||
directory = new Directory(directoryPath)
|
||||
if (url.parse(directoryPath).protocol)
|
||||
directory.path = directoryPath;
|
||||
if (fs.isCaseInsensitive())
|
||||
directory.lowerCasePath = directoryPath.toLowerCase();
|
||||
directory
|
||||
|
||||
# Public: Create a Directory that corresponds to the specified URI.
|
||||
#
|
||||
|
||||
@@ -23,12 +23,12 @@ class WindowEventHandler
|
||||
if pathToOpen? and needsProjectPaths
|
||||
if fs.existsSync(pathToOpen)
|
||||
atom.project.addPath(pathToOpen)
|
||||
else if fs.existsSync(path.dirname(pathToOpen))
|
||||
atom.project.addPath(path.dirname(pathToOpen))
|
||||
else
|
||||
dirToOpen = path.dirname(pathToOpen)
|
||||
if fs.existsSync(dirToOpen)
|
||||
atom.project.addPath(dirToOpen)
|
||||
atom.project.addPath(pathToOpen)
|
||||
|
||||
unless fs.isDirectorySync(pathToOpen)
|
||||
if fs.isFileSync(pathToOpen)
|
||||
atom.workspace?.open(pathToOpen, {initialLine, initialColumn})
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user