Bug 429539 - Allowing mixing syntax highlights
Summary: Allowing mixing syntax highlights
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: 20.08.2
Platform: Kubuntu Linux
: LO wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-23 10:29 UTC by Marcos Dione
Modified: 2020-12-14 07:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Dione 2020-11-23 10:29:10 UTC
It is not uncommon to have a mix of languages on the same source:

* salt and ansible use jinja for templating configuration files; salt even mixes jinja and yaml.
* php sources can have HTML, JS and even SQL (4 languages!) in the same source.
* etc.

Kate only allows one syntax highlighting (SHL) at a time, rendering part of the code as plain text or worse. It would be nice if SHLs could be combined in the same view. For templating languages like jinja, it seems easy(er); PHP should definitely be harder (specially detecting SQL queries).
Comment 1 Christoph Cullmann 2020-12-12 14:58:56 UTC
We already support mixing, but that must be done in the individual syntax definition files. You can reference there other highlightings for parts of a document.

If you want to improve on this for some languages, please provide some patch to

https://invent.kde.org/frameworks/syntax-highlighting
Comment 2 Marcos Dione 2020-12-14 07:52:09 UTC
Perfect. I will try to do that for YAML based .sls files (Salt). The only remaining question: what the best way to force kate to reread the syntax files? and is there a way to debug them somehow? Cheers!