Ticket #4246 (closed enhancement: fixed)

Opened 5 weeks ago

Last modified 3 weeks ago

[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

0001-Syntax.in-add-syntax-support-for-openrc-run-scripts[1].patch (675 bytes) - added by TerraNova 4 weeks ago.

Change History

comment:1 Changed 4 weeks ago by andrew_b

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.

comment:2 Changed 4 weeks 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 weeks ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.27

comment:4 Changed 3 weeks 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:5 Changed 3 weeks ago by andrew_b

  • Status changed from testing to closed

comment:6 follow-up: ↓ 7 Changed 3 weeks 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 weeks 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 weeks 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 weeks 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 weeks ago by ossi

swap "only" and "the" in front of "shebang".
looks ok otherwise.

comment:11 Changed 3 weeks 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 weeks 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
Note: See TracTickets for help on using tickets.