[TxMt] Re: how do I confine a begin-end pattern to within a single paragraph?
Allan Odgaard
mailinglist at textmate.org
Mon Jan 20 08:49:32 UTC 2014
On 20 Jan 2014, at 2:41, Matt Neuburg wrote:
> repository = {
> single_bold = {
> name = 'markup.bold.asciidoc';
> begin = '\*';
> end = '\*';
> };
> };
Adding to my previous reply, if a single asterisk is a user error (when
not matched by a bullet list rule or bold) then another approach could
be to do something like this:
single_bold = {
name = 'markup.bold.asciidoc';
begin = '\*';
end = '\*|(\n)';
endCaptures = {
1 = { name =
'invalid.illegal.unterminated_asterisk.asciidoc'; };
};
};
Here we terminate the rule either when seeing an asterisk or seeing a
newline character, and in the latter case, we scope the newline as
“invalid.illegal” which, with most themes, should give it a red
background.
More information about the textmate
mailing list