Small syntax definition fixes and a new theme #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I took your advice and forked. I updated the regexes for citation, math, and header matching. I also created a new theme. As of now, only my theme supports LaTeX highlighting, but I can update the other three themes if you like it.
TODO:
I tried to set up (i) table highlighting with a light gray background and (ii) automatically numbered lists, which are currently recognized as headers.
For (i), I have a regex which will match pipe and grid tables:
((\+\-+)+\+(\n.+)*(\+\-+)+\+)|(((\|.*){2,}\n){2,})
but I think .tmLanguage doesn't like to match regexes over multiple lines. I could definitely figure out how to do it, probably with the \G symbol which I am yet to understand. However, the main utility of such highlighting would be to point out when a table is poorly constructed, and I'm not sure how you would do that with this system.For (ii) I thought it would be as simple as adding a
#\.
every time I saw^[ ]{0,3}([0-9]+\.|[a-z]\.)(?=\s)
but I guess it's not so simple…Cheers