xobb1t/Sublime-AdvancedNewFile — pull request #7 by aventurella (2012-04-20 16:35:22+00:00)
Title: Ability to select alternate top level project folder by prefixing path with <name>:

If you have multiple top level project folders, the current behavior is to default to *self.window.folders()[0]*. This amendment allows you to specify an alternate top level project folder in the path creation string.

For example, if you have 2 top level project folders in the sublime project window:

```
foo/
stuff.py

bar/
other_stuff.py
```

launching the dialog and typing in:
**tests/test_stuff.py**

would, by default, create a tests folder containing test_stuff.py, leaving us with the following:

```
foo/
stuff.py
tests/
test_stuff.py

bar/
other_stuff.py
```
but what if we wanted to target 'bar' for the file creation? Now you can:

Launching the dialog and typing in:
**bar:tests/test_other_stuff.py**

Note the *:* prefix

This would now leave us with the following:

```
foo/
stuff.py
tests/
test_stuff.py

bar/
other_stuff.py
tests/
test_other_stuff.py
```

What if someone types in a non-existant top level folder?

Launching the dialog and typing in:
**fkdsjfksdk:tests/test_other_stuff.py**

It will default to:
*self.window.folders()[0]*

Additionally what if someone does something funky:
**bar:lets:mess:it:up/test.py**

The result would be:

```
foo/
stuff.py
tests/
test_stuff.py

bar/
other_stuff.py
lets:mess:it:up/
test.py

tests/
test_other_stuff.py
```

An idea for one more optimization **not** currently present:
**bar:lets:mess:it:up/test.py**

Would be converted too:
**bar:lets/mess/it/up/test.py**