mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Don't add a trailing slash when adding file to projects root dir
This commit is contained in:
@@ -382,6 +382,15 @@ describe "TreeView", ->
|
||||
expect(addDialog.miniEditor.getCursorBufferPosition().column).toBe addDialog.miniEditor.getText().length
|
||||
expect(addDialog.miniEditor.isFocused).toBeTruthy()
|
||||
|
||||
describe "when the root directory is selected", ->
|
||||
it "opens an add dialog with no path populated", ->
|
||||
addDialog.cancel()
|
||||
treeView.root.click()
|
||||
treeView.trigger "tree-view:add"
|
||||
addDialog = rootView.find(".add-dialog").view()
|
||||
|
||||
expect(addDialog.miniEditor.getText().length).toBe 0
|
||||
|
||||
describe "tree-view:move", ->
|
||||
describe "when a file is selected", ->
|
||||
moveDialog = null
|
||||
|
||||
@@ -21,7 +21,8 @@ class AddDialog extends View
|
||||
@miniEditor.on 'focusout', => @remove()
|
||||
|
||||
directoryPath = if fs.isFile(@path) then fs.directory(@path) else @path
|
||||
relativePath = @rootView.project.relativize(directoryPath) + '/'
|
||||
relativePath = @rootView.project.relativize(directoryPath)
|
||||
relativePath += '/' if relativePath.length > 0
|
||||
@miniEditor.setText(relativePath)
|
||||
|
||||
confirm: ->
|
||||
|
||||
Reference in New Issue
Block a user