mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Use _ for an empty project root or editor path group
Co-Authored-By: Jason Rudolph <jason@jasonrudolph.com>
This commit is contained in:
@@ -26,32 +26,36 @@ describe('AtomApplication', function () {
|
||||
describe('with no open windows', function () {
|
||||
it('opens a file', async function () {
|
||||
await scenario.launch(parseCommandLine(['a/1.md']))
|
||||
await scenario.assert('[ 1.md]')
|
||||
await scenario.assert('[_ 1.md]')
|
||||
})
|
||||
|
||||
it('opens a directory', async function () {
|
||||
await scenario.launch(parseCommandLine(['a']))
|
||||
await scenario.assert('[a ]')
|
||||
await scenario.assert('[a _]')
|
||||
})
|
||||
|
||||
it('opens a file with --add', async function () {
|
||||
await scenario.launch(parseCommandLine(['--add', 'a/1.md']))
|
||||
await scenario.assert('[ 1.md]')
|
||||
await scenario.assert('[_ 1.md]')
|
||||
})
|
||||
|
||||
it('opens a directory with --add', async function () {
|
||||
await scenario.launch(parseCommandLine(['--add', 'a']))
|
||||
await scenario.assert('[a ]')
|
||||
await scenario.assert('[a _]')
|
||||
})
|
||||
|
||||
it('opens a file with --new-window', async function () {
|
||||
await scenario.launch(parseCommandLine(['--new-window', 'a/1.md']))
|
||||
await scenario.assert('[ 1.md]')
|
||||
await scenario.assert('[_ 1.md]')
|
||||
})
|
||||
|
||||
it('opens a directory with --new-window', async function () {
|
||||
await scenario.launch(parseCommandLine(['--new-window', 'a']))
|
||||
await scenario.assert('[a _]')
|
||||
})
|
||||
|
||||
it('opens a directory with --new-window', async function () {
|
||||
await scenario.launch(parseCommandLine(['--new-window', 'a']))
|
||||
await scenario.assert('[a ]')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -383,13 +387,13 @@ class LaunchScenario {
|
||||
parseWindowSpecs (source) {
|
||||
const specs = []
|
||||
|
||||
const rx = /\s*\[(\S*) (\S*)\]/g
|
||||
const rx = /\s*\[(?:_|(\S+)) (?:_|(\S+))\]/g
|
||||
let match = rx.exec(source)
|
||||
|
||||
while (match) {
|
||||
specs.push({
|
||||
roots: match[1].split(','),
|
||||
editors: match[2].split(',')
|
||||
roots: (match[1] || '').split(','),
|
||||
editors: (match[2] || '').split(',')
|
||||
})
|
||||
|
||||
match = rx.exec(source)
|
||||
|
||||
Reference in New Issue
Block a user