emacs syntax lexer: bad mix of greediness & laziness #2856
Merged
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.
#2784 provides correct highlighting by eyeball, as tested, however I have since discovered through dev use that it is occasionally slowed, & sometimes hangs, in practice. I have traced this back to the typing of the opening but not yet closing marker for specific syntactical expressions, namely:
{#
towards{# ... #}
{%
towards{% ... %}
... & in turn to a mix of greedy & lazy quantifiers in the associated regular expressions, which have identical format bar the
#
/%
distinction. This PR replaces those instances at fault.(This bug discovery will be another lesson to label on my steep learning curve in regular expressions.)
Also amend one other issue manifest with regular use; a task with plain-text name on the first line of a graph string is recognised as a key for a
key = value
pair from not considering the subsequent>
, e.g:highlights
plaintexttask
in the same colour asgraph
& notnot_just_plain_text_task
as makes sense contextually.