Merge pull request #6706 from atom/iz-fix-open-with-trailing-colon

Ignore trailing colons and whitespace when opening files from command line
This commit is contained in:
Kevin Sawicki
2015-05-08 13:59:08 -07:00
2 changed files with 66 additions and 1 deletions

View File

@@ -512,6 +512,8 @@ class AtomApplication
return {pathToOpen} unless pathToOpen
return {pathToOpen} if fs.existsSync(pathToOpen)
pathToOpen = pathToOpen.replace(/[:\s]+$/, '')
[fileToOpen, initialLine, initialColumn] = path.basename(pathToOpen).split(':')
return {pathToOpen} unless initialLine
return {pathToOpen} unless parseInt(initialLine) >= 0