-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for MacOS crontab syntax highlighting #3172
Comments
This is not only a Maybe something |
Hi @JoeKar, I think there is a misunderstanding. I'm suggesting to add (The current regex is To be more complete: Further checking shows that the new regex would add support for detecting While the current regex is already matching |
I don't think so. What I was really referring to was the fact that adding an explicit file path will maybe solve it for the current scenario, but what if the temporary path will be different from I'd like to fix this more generic and already thought about file edits besides |
That looks more complex than the regex for most other filetypes...but sure, it covers the |
A lot of the other file types describe whole languages and some of them a specific files. If these files are located at location the user usually can't write in the first place, then they should get this more complex rule to cover the above mentioned scenarios as well. @dmaluka |
Not in all cases. If the file has an extension, e.g.
I think: imagine you're a cron developer, and you are opening crontab.c. Do you want it to be highlighted as a C file or as a crontab file? Well, actually you'd be lucky and it would be highlighted as a C file, just because Well, we have support for file signature checks, which you implemented in #2819, which should help in such ambiguous situations. And it does help... as long as we do have suitable signatures for the given pair of file types, sufficient for distinguishing between them. In this particular case, and probably in most other cases, we don't. ...All that said, I'm not entirely opposed to your idea, and I'm even having crazy thoughts about generalizing it even more (for example, I'm occasionally renaming e.g. |
BTW here is the relevant code: https://github.com/sudo-project/sudo/blob/main/src/sudo_edit.c#L134 And here is the relevant code deciding in which directory to create the temporary file: https://github.com/sudo-project/sudo/blob/main/src/sudo_edit.c#L63. Looks like it is created in either of So, among the particular file types you mentioned,
|
Ok, then for now we should go with the proposed solution from you (extended version of @nv-pipo). |
Support crontab filetype detection in the case crontab is opened via sudoedit. Also apparently this fixes crontab filetype detection when it is opened normally via `crontab -e` but in MacOS. Fixes zyedidia#3172
Support crontab filetype detection in the case crontab is opened via sudoedit. Also apparently this fixes crontab filetype detection when it is opened normally via `crontab -e` but in MacOS. Fixes #3172
Description of the problem or steps to reproduce
The default configuration doesn't highlight crontab on MacOS, when running 'crontab -e'
Specifications
Version: 2.0.13
Commit hash: 68d88b5
Compiled on October 21, 2023
OS: MacOS 14.3.1
Terminal: alacritty
Solution
Create a file '~/.config/micro/syntax/crontab.yaml', and add detection for MacOS file path:
After that, micro is able to detect crontab on MacOS:
Request
For others, could you please update the default
runtime/syntax/crontab.yaml
file to add support for MacOS crontab paths?The text was updated successfully, but these errors were encountered: