Consistently operate on result.pathToOpen

This commit is contained in:
Ash Wilson
2019-04-19 14:37:26 -04:00
parent d3bb28f1a4
commit 28116828a1

View File

@@ -1438,11 +1438,11 @@ class AtomApplication extends EventEmitter {
return result
}
pathToOpen = pathToOpen.replace(/[:\s]+$/, '')
const match = pathToOpen.match(LocationSuffixRegExp)
result.pathToOpen = result.pathToOpen.replace(/[:\s]+$/, '')
const match = result.pathToOpen.match(LocationSuffixRegExp)
if (match != null) {
result.pathToOpen = pathToOpen.slice(0, -match[0].length)
result.pathToOpen = result.pathToOpen.slice(0, -match[0].length)
if (match[1]) {
result.initialLine = Math.max(0, parseInt(match[1].slice(1), 10) - 1)
}