fix order of file creation from template:
1. create the file
2. if it's not unnamed write it to disk
3. add it to the project
4. open view content