Closed gwax closed 6 years ago
👋 Hey @gwax,
This is impossible for two reasons, both of which relate to limitations in the syntax highlighting engine used by Atom:
It's impossible for the engine to process more than one line at a time. This is done for speed: with every change a user makes, the document needs to be reprocessed, and being able to do this from an arbitrary location helps performance.
The engine has no concept of state.
Since the order in which section markers appear determines a document's hierarchy, the highlighting engine must "remember" which characters denote top-level headings, subheadings, tertiary headings, and so forth. We can't assume that ======
will always represent heading-1
, --------
represent heading-2
, as it is in Markdown.
I know it's a pain. Lightweight markup languages like AsciiDoc and reStructuredText are the worst affected by the highlighting engine's limitations. :(
Bummer.
Thank you @Alhadis for the very clear and detailed response to my issue.
Right now headings are not highlighted and only have the scope
text.restructuredtext
. Please add additional scopes to allow syntax highlighting:heading.markup.restructuredtext
for all headings, andheading-#.restructuredtext
where#
is the pertinent numbered heading.