Currently, the filetype is autodetected only when a new document is opened. If a user adds a filetype shebang line, the only way to redetect the filetype is to close and reopen the document. (While the user could manually change the filetype, the purpose of the shebang line is to avoid manual filetype selection, which is cumbersome because of the multiply nested menus.)
The following change could address this issue without affecting most other users:
There is a PR (not yet merged) for the project organizer plugin that changes the filetype of header files to match the corresponding source file. It currently does so only on the document-open signal, so changing the filetype on could cause the "wrong" filetype to be reassigned to the header. However, since the change would be restricted to when the current filetype is None or a new type is determined by shebang, incorrect filetype reassignment is unlikely.
This functionality cannot be implemented in a plugin because filetypes_detect_from_file
does not report whether the filetype was detected from filename or shebang line.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.