Merge branch 'master' of github.com:github/atom

This commit is contained in:
Nathan Sobo
2012-07-04 12:34:56 -06:00
34 changed files with 91 additions and 49 deletions

View File

@@ -0,0 +1,17 @@
window.keymap.bindKeys '#root-view'
'alt-tab': 'tree-view:focus'
'ctrl-T': 'tree-view:toggle'
window.keymap.bindKeys '.tree-view'
'right': 'tree-view:expand-directory'
'left': 'tree-view:collapse-directory'
'enter': 'tree-view:open-selected-entry'
'm': 'tree-view:move'
'a': 'tree-view:add'
'delete': 'tree-view:remove'
'backspace': 'tree-view:remove'
'alt-tab': 'tree-view:unfocus'
window.keymap.bindKeys '.tree-view-dialog .mini.editor'
'enter': 'tree-view:confirm'
'escape': 'tree-view:cancel'

View File

@@ -171,7 +171,7 @@ class TreeView extends View
newPath = @rootView.project.resolve(newPath)
directoryPath = fs.directory(newPath)
try
fs.makeDirectory(directoryPath) unless fs.exists(directoryPath)
fs.makeTree(directoryPath) unless fs.exists(directoryPath)
fs.move(oldPath, newPath)
catch e
dialog.showError("Error: " + e.message + " Try a different path:")
@@ -208,15 +208,15 @@ class TreeView extends View
endsWithDirectorySeperator = /\/$/.test(relativePath)
path = @rootView.project.resolve(relativePath)
try
if endsWithDirectorySeperator
fs.makeDirectory(path)
if fs.exists(path)
pathType = if fs.isFile(path) then "file" else "directory"
dialog.showError("Error: A #{pathType} already exists at path '#{path}'. Try a different path:")
false
else if endsWithDirectorySeperator
fs.makeTree(path)
else
if fs.exists(path)
dialog.showError("Error: A file already exists at path '#{path}'. Try a different path:")
false
else
fs.write(path, "")
@rootView.open(path)
fs.write(path, "")
@rootView.open(path)
catch e
dialog.showError("Error: " + e.message + " Try a different path:")
return false