Ticket #4246 (closed enhancement: fixed)
[PATCH] Syntax.in: add syntax highlighting support for openrc-run scripts
Reported by: | TerraNova | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.27 |
Component: | mcedit | Version: | master |
Keywords: | patch syntax | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
openrc-run scripts use sh syntax highlighting, but since they don't use extensions per se, then we need to key off the shebang line.
Attachments
Change History
Changed 4 years ago by TerraNova
- Attachment 0001-Syntax.in-add-syntax-support-for-openrc-run-scripts[1].patch added
comment:2 Changed 4 years ago by TerraNova
I was not 100% sure what pattern I should have used when technically I was only keying off the shebang line and not the extension. I've updated the patch. Thank you for the review and feedback.
comment:3 Changed 3 years ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- Milestone changed from Future Releases to 4.8.27
comment:4 Changed 3 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset set to committed-master
- Resolution set to fixed
- Branch state changed from no branch to merged
Applied with small changes: [3d5fadd2bbd4faf1c882bb18621a982cfd3a03c0].
comment:6 follow-up: ↓ 7 Changed 3 years ago by gszymaszek
Hi! I’m afraid this patch has caused mc to use the openrc-run script syntax highlighting in some unrelated types of files, for example in C code. Could you check it again?
comment:7 in reply to: ↑ 6 Changed 3 years ago by andrew_b
Replying to gszymaszek:
Hi! I’m afraid this patch has caused mc to use the openrc-run script syntax highlighting in some unrelated types of files, for example in C code. Could you check it again?
Confirmed. I think this is another issue: #4252.
comment:8 Changed 3 years ago by andrew_b
- Status changed from closed to reopened
- Votes for changeset committed-master deleted
- Resolution fixed deleted
- Branch state changed from merged to no branch
comment:9 Changed 3 years ago by andrew_b
- Branch state changed from no branch to on review
Branch: 4246_openrc_syntax
changeset:fdb5a49dc10b642acc2b41fa75e2b0bb6eddf8ab
Please test.
comment:10 Changed 3 years ago by ossi
swap "only" and "the" in front of "shebang".
looks ok otherwise.
comment:11 Changed 3 years ago by andrew_b
- Votes for changeset set to ossi andrew_b
- Branch state changed from on review to approved
Thanks!
comment:12 Changed 3 years ago by andrew_b
- Status changed from reopened to closed
- Votes for changeset changed from ossi andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [cde941ba3236f9e3a73bd2e936d43d2fe08f9d93].
The pattern ^$ works only if rule is first. From other side, this pattern matches an empty file name, and this is confusing the user.
Why not use the .\* pattern which is works regardless of rule place? Together with line #!/sbin/openrc-run it works fine.