| Summary: | Keyword list items w/ context | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Alex Turbov <i.zaufi> |
| Component: | framework | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | All | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Doing a new syntax file, I again hit the pattern when I need per keyword context switch. E.g. smth like this: ```xml <highlighting> <list name="commands"> <item>satu</item> <item context="dua_ctx">dua</item> <item>tiga</item> <item context="empat_ctx">empat</item> </list> <contexts> <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text"> <!-- ... --> <keyword attribute="Command" context="#stay" String="commands"/> <!-- ... --> </context> <context attribute="Command Args" lineEndContext="#stay" name="dua_ctx"> <!-- special case for the `dua` command --> </context> <context attribute="Command Args" lineEndContext="#stay" name="empat_ctp"> <!-- special case for the `empat` command --> </context> <!-- ... --> </contexts> <!-- ... --> ``` I.e., for the keyword list items w/ context attribute, switch to the specified context in case of a match. Otherwise, if not specified per item context, switch to the context specified in the `keyword` rule. It'll be nice if anyone can implement it ;-)