Automatically detect syntax style from shebang
When creating a new document, the first line could be inspected to look for a shebang like #!/usr/bin/env python3 or #!/usr/bin/ruby, allowing to automatically set the syntax style of the document.
This is especially useful to avoid setting the syntax style when pasting scripts to a new blank document.
Hmm, interesting. The feature setting syntax style from shebang has already been implemented in CotEditor, but only when a file is opened (and there is no other clue in the filename), or when the document is firstly saved.
I feel I need to find the proper timing to detect the shebang. Maybe 1) the document is newly created, 2) the syntax style is not changed from the default, and 3) the first time a line break is input. In addition, I am now wondering if it worth to observe user's typing for such a rare case. Well, I'll consider. Thanks.