Skip to content

include ya?ml.j2 files in yaml syntax highlighting#5133

Closed
richlv wants to merge 1 commit into
MidnightCommander:masterfrom
richlv:patch-1
Closed

include ya?ml.j2 files in yaml syntax highlighting#5133
richlv wants to merge 1 commit into
MidnightCommander:masterfrom
richlv:patch-1

Conversation

@richlv

@richlv richlv commented Jul 8, 2026

Copy link
Copy Markdown

Proposed changes

Includes YAML Jinja2 files for YAML syntax highlighting.

Checklist

👉 Our coding style can be found here: https://midnight-commander.org/coding-style/ 👈

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Signed-off-by: Richlv <richlv@nakts.net>
@github-actions github-actions Bot added the needs triage Needs triage by maintainers label Jul 8, 2026
@github-actions github-actions Bot added this to the Future Releases milestone Jul 8, 2026
@github-actions github-actions Bot added the prio: medium Has the potential to affect progress label Jul 8, 2026
@zyv zyv added area: mcedit mcedit, the built-in text editor and removed needs triage Needs triage by maintainers labels Jul 8, 2026
@zyv

zyv commented Jul 8, 2026

Copy link
Copy Markdown
Member

I think that I understand your intent - probably you're working on Jinja-templated Ansible manifests and want to have at least some sort of highlighting, but I don't think that we can accept this solution upstream.

The proper one would be composite syntaxes for multiple languages, which our engine doesn't support.

Your kludge of just ignoring Jinja constructs and highlighting YAML anyways might (or might not) be better than nothing, but this brings another question: where do we stop?

Do we add j2 extension to every file that can be templated? This is obviously nonsense. And for now we have no precedent for doing this.

I'm afraid that at the moment, the best place for such changes if you really want them is per-user customization.

@zyv zyv closed this Jul 8, 2026
@github-actions github-actions Bot removed this from the Future Releases milestone Jul 8, 2026
@richlv

richlv commented Jul 8, 2026

Copy link
Copy Markdown
Author

Thanks, noted. Regarding "where do we stop" one approach could be pragmatic - whatever is popular enough :)
But I can understand the desire to keep it max clean.
Is there any way to override or add one line only, and read the rest from the system-wide file?

@zyv

zyv commented Jul 8, 2026

Copy link
Copy Markdown
Member

But I can understand the desire to keep it max clean.

Oh, it's more like cleanish, or at least not much dirtier than it currently is... :-/

Is there any way to override or add one line only, and read the rest from the system-wide file?

I think you might be able to include the global syntax from the local one, but I haven't checked. This could be a solution for #1984.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

2 participants