mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user