-
-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request : add an option to the File Mapping for the First Line Pattern #1437
Comments
A simple "workaround" implementation could be to extend File Mapping Interpreters option:
What fo you think ? |
I understood your need.
I feel those examples both are not good idea. |
Agree that Then what about a special "tag" in Interpreter name to mark it as a "first line pattern" -- for example "^" ? then :
e.g. I can change the context of the file, but cannot give it any extension (since it's a Blob file) -- the only question if CotEditor can match something from the file context to auto-discover its syntax. Of course adding a dedicated option for the first line pattern could be much more clean solution, but I understand it'll take time, so just looking for something more simple to add.. |
Currently CotEditor is able to auto-detect file type by file extension, shebang interpreter or explicit file name. However, sometimes no one of them could be matched due whatever reasons (auto-renamed email attachment, files are saved as Blobs and just having long hex numbers in the name, etc). To help such cases many code editors introduced an option to auto-detect the file type by the checking the pattern for the first line in the file (generally regex) which works really well.
For ex. for HTML detecting "<!-- " in the first line is enough, for Lua "-- " and so on.
Would be great to add the same feature to CotEditor.
Rgds,
-Dimitri
The text was updated successfully, but these errors were encountered: