Open files from selection

- Removed redundant check for file existence.
- Using doc->file_type to determine the current file extension
- fixed styling of brackets