Skip to content

Syntax highlighting spans where the end condition depends on the begin condition #309

Description

@khhelland

Hi, I'm using AvalonEdit for a Lua editor. I want to properly highlight multiline comments, but the end condition can depend on the begining condition.
The format is
"
--[[
Comment
]]
"
, but also
"
--[===[
Comment
]===]
"
where the number of "="s must match.

I've tried using a span like so:

	<Span color="Comment" multiline="true" begin="--\[(=*)\[" end="\]$1\]"/\>

but this does not work.

Is it possible to use a group captured in the "begin" in the "end"?
And if not is there another way to accomplish this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions